-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix more issues with GHA and AWS deployment
- Loading branch information
Showing
2 changed files
with
59 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Build all the things | ||
FROM node:20.5-bullseye-slim AS build | ||
RUN apt-get update -y && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y libc6 && \ | ||
apt-get clean | ||
ENV NODE_ENV production | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
WORKDIR /app | ||
|
||
COPY .yarn ./.yarn | ||
COPY public ./public | ||
COPY src ./src | ||
|
||
COPY .browserlistrc \ | ||
.yarnrc.yml \ | ||
components.json \ | ||
entrypoint.sh \ | ||
index.js \ | ||
logger.js \ | ||
next.config.mjs \ | ||
package.json \ | ||
postcss.config.js \ | ||
README.md \ | ||
tailwind.config.js \ | ||
tsconfig.json \ | ||
yarn.lock \ | ||
.env.local \ | ||
./ | ||
|
||
RUN yarn install | ||
|
||
RUN yarn build | ||
|
||
# Copy only the built files into the final image | ||
FROM node:20.5-bullseye-slim AS runner | ||
ENV NODE_ENV production | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
WORKDIR /app | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=build --chown=nextjs:nodejs /app/.next ./.next | ||
COPY --from=build --chown=nextjs:nodejs /app/entrypoint.sh ./entrypoint.sh | ||
COPY --from=build /app/node_modules ./node_modules | ||
COPY --from=build /app/package.json ./package.json | ||
COPY --from=build /app/index.js ./index.js | ||
COPY --from=build /app/.env.local ./.env.local | ||
|
||
USER nextjs | ||
|
||
EXPOSE 3000 | ||
ENV PORT 3000 | ||
|
||
ENTRYPOINT ["/app/entrypoint.sh"] |