Skip to content

Commit

Permalink
Fix more issues with GHA and AWS deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagojsag committed Oct 25, 2023
1 parent d386c36 commit 836feec
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
uses: actions/checkout@v3

- uses: dorny/paths-filter@v2
id: api-changes
id: cms-changes
with:
filters: |
cms:
Expand Down
58 changes: 58 additions & 0 deletions client/Dockerfile.prod
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"]

0 comments on commit 836feec

Please sign in to comment.