-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from reginaldbondoc/I-36-use-pre-built-fronten…
…d-image I-36 Use pre-built frontend image instead of building Next.js app on boot
- Loading branch information
Showing
13 changed files
with
234 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,24 +9,24 @@ Configuring Infisical requires setting some environment variables. There is a fi | |
|
||
| Variable | Description | Default Value | | ||
| ---------------------------- | ----------------------------------------------------------------------------------------------------------- | ---------------- | | ||
| `PRIVATE_KEY` | ❗️ NaCl-generated server secret key | `None` | | ||
| `PUBLIC_KEY` | ❗️ NaCl-generated server public key | `None` | | ||
| `ENCRYPTION_KEY` | ❗️ Strong hex encryption key | `None` | | ||
| `JWT_SIGNUP_SECRET` | ❗️JWT token secret | `None` | | ||
| `JWT_REFRESH_SECRET` | ❗️ JWT token secret | `None` | | ||
| `JWT_AUTH_SECRET` | ❗️ JWT token secret | `None` | | ||
| `PRIVATE_KEY` | ❗️ NaCl-generated server secret key | `None` | | ||
| `PUBLIC_KEY` | ❗️ NaCl-generated server public key | `None` | | ||
| `ENCRYPTION_KEY` | ❗️ Strong hex encryption key | `None` | | ||
| `JWT_SIGNUP_SECRET` | ❗️ JWT token secret | `None` | | ||
| `JWT_REFRESH_SECRET` | ❗️ JWT token secret | `None` | | ||
| `JWT_AUTH_SECRET` | ❗️ JWT token secret | `None` | | ||
| `JWT_SIGNUP_LIFETIME` | JWT token lifetime expressed in seconds or a string describing a time span (e.g. 60, "2 days", "10h", "7d") | `15m` | | ||
| `JWT_REFRESH_LIFETIME` | JWT token lifetime expressed in seconds or a string describing a time span (e.g. 60, "2 days", "10h", "7d") | `90d` | | ||
| `JWT_AUTH_LIFETIME` | JWT token lifetime expressed in seconds or a string describing a time span (e.g. 60, "2 days", "10h", "7d") | `10d` | | ||
| `EMAIL_TOKEN_LIFETIME` | Email OTP/magic-link lifetime expressed in seconds | `86400` | | ||
| `MONGO_URL` | ❗️ MongoDB instance connection string either to container instance or MongoDB Cloud | `None` | | ||
| `MONGO_URL` | ❗️ MongoDB instance connection string either to container instance or MongoDB Cloud | `None` | | ||
| `MONGO_USERNAME` | MongoDB username if using container | `None` | | ||
| `MONGO_PASSWORD` | MongoDB password if using container | `None` | | ||
| `SITE_URL` | ❗️ Site URL - should be an absolute URL including the protocol (e.g. `https://app.infisical.com`) | `None` | | ||
| `SMT_HOST` | Whether the user joined the community | `smtp.gmail.com` | | ||
| `SMTP_NAME` | Hostname to connect to for establishing SMTP connections (e.g. `Team`) | `None` | | ||
| `SMTP_USERNAME` | ❗️ Credential to connect to host (e.g. `[email protected]`) | `None` | | ||
| `SMTP_PASSWORD` | ❗️ Credential to connect to host | `None` | | ||
| `SITE_URL` | ❗️ Site URL - should be an absolute URL including the protocol (e.g. `https://app.infisical.com`) | `None` | | ||
| `SMTP_HOST` | Hostname to connect to for establishing SMTP connections | `smtp.gmail.com` | | ||
| `SMTP_NAME` | Name label to be used in From field (e.g. `Team`) | `None` | | ||
| `SMTP_USERNAME` | ❗️ Credential to connect to host (e.g. `[email protected]`) | `None` | | ||
| `SMTP_PASSWORD` | ❗️ Credential to connect to host | `None` | | ||
| `TELEMETRY_ENABLED` | `true` or `false`. [More](../overview). | `true` | | ||
| `OAUTH_CLIENT_SECRET_HEROKU` | OAuth client secret for Heroku integration | `None` | | ||
| `OAUTH_TOKEN_URL_HEROKU` | OAuth token URL for Heroku integration | `None` | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
ARG POSTHOG_HOST=https://app.posthog.com | ||
ARG POSTHOG_API_KEY=posthog-api-key | ||
|
||
FROM node:16-alpine AS deps | ||
# Install dependencies only when needed. Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | ||
# RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
# Copy over dependency files | ||
COPY package.json package-lock.json next.config.js ./ | ||
|
||
# Install dependencies | ||
RUN npm ci --only-production | ||
|
||
|
||
# Rebuild the source code only when needed | ||
FROM node:16-alpine AS builder | ||
WORKDIR /app | ||
|
||
# Copy dependencies | ||
COPY --from=deps /app/node_modules ./node_modules | ||
# Copy all files | ||
COPY . . | ||
|
||
ENV NODE_ENV production | ||
ENV NEXT_PUBLIC_ENV production | ||
ARG POSTHOG_HOST | ||
ENV NEXT_PUBLIC_POSTHOG_HOST $POSTHOG_HOST | ||
ARG POSTHOG_API_KEY | ||
ENV NEXT_PUBLIC_POSTHOG_API_KEY $POSTHOG_API_KEY | ||
|
||
# Build | ||
RUN npm run build | ||
|
||
|
||
# Production image | ||
FROM node:16-alpine AS runner | ||
WORKDIR /app | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
RUN mkdir -p /app/.next/cache/images && chown nextjs:nodejs /app/.next/cache/images | ||
VOLUME /app/.next/cache/images | ||
|
||
ARG POSTHOG_API_KEY | ||
ENV NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY \ | ||
BAKED_NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY | ||
|
||
COPY --chown=nextjs:nodejs --chmod=555 scripts ./scripts | ||
COPY --from=builder /app/public ./public | ||
RUN chown nextjs:nodejs ./public/data | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
|
||
CMD ["/app/scripts/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.