-
-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
517 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.env | ||
|
||
Dockerfile | ||
./**/*/Dockerfile | ||
|
||
.dockerignore | ||
|
||
node_modules | ||
./**/*/node_modules | ||
|
||
pnpm-debug.log | ||
./**/*/pnpm-debug.log | ||
|
||
|
||
README.md | ||
.next | ||
.git | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
18 | ||
18.15.0 |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
##### DEPENDENCIES | ||
|
||
FROM --platform=linux/amd64 node:18-alpine AS builder | ||
RUN apk add --no-cache libc6-compat openssl1.1-compat && apk update | ||
WORKDIR /app | ||
RUN yarn global add turbo | ||
COPY . . | ||
RUN turbo prune --scope=@acme/nextjs --docker | ||
|
||
FROM --platform=linux/amd64 node:18-alpine AS installer | ||
RUN apk add --no-cache libc6-compat openssl1.1-compat && apk update | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
ENV CI true | ||
ENV SKIP_ENV_VALIDATION true | ||
|
||
COPY .gitignore .gitignore | ||
COPY --from=builder /app/tsconfig.json ./tsconfig.json | ||
COPY --from=builder /app/out/json . | ||
COPY --from=builder /app/out/pnpm-lock.yaml\* ./ | ||
|
||
RUN yarn global add pnpm && pnpm install --frozen-lockfile | ||
|
||
COPY --from=builder /app/out/full . | ||
|
||
RUN pnpm turbo build --filter=nextjs | ||
|
||
FROM --platform=linux/amd64 node:18-alpine AS runner | ||
RUN apk add --no-cache libc6-compat openssl1.1-compat && apk update | ||
WORKDIR /app | ||
|
||
# Don't run production as root | ||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
USER nextjs | ||
EXPOSE 3000 | ||
ENV PORT 3000 | ||
|
||
ENV NODE_ENV production | ||
|
||
# ENV NEXT_TELEMETRY_DISABLED 1 Optional | ||
|
||
COPY --from=installer /app/apps/nextjs/next.config.mjs ./ | ||
COPY --from=installer /app/apps/nextjs/package.json ./ | ||
|
||
COPY --from=installer --chown=nextjs:nodejs /app/apps/nextjs/.next/standalone ./ | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/nextjs/.next/static ./apps/nextjs/.next/static | ||
COPY --from=installer --chown=nextjs:nodejs /app/apps/nextjs/public ./apps/nextjs/public | ||
|
||
|
||
CMD node apps/nextjs/server.js |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: "3.7" | ||
|
||
services: | ||
nextjs: | ||
ports: | ||
- "3000:3000" | ||
build: | ||
context: . | ||
dockerfile: ./apps/nextjs/Dockerfile | ||
environment: | ||
- DATABASE_URL=${DATABASE_URL} | ||
- NEXTAUTH_URL=${NEXTAUTH_URL} | ||
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET} | ||
- DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID} | ||
- DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET} |
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.