Robert Burgess 2024-08-15 23:02:13 -04:00
commit 9219d32102
1 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# Install dependencies only when needed
FROM node:18-alpine3.19 AS deps
FROM node:20-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
@ -7,7 +7,7 @@ RUN yarn config set network-timeout 100000
RUN yarn install
# Rebuild the source code only when needed
FROM node:18-alpine3.19 AS builder
FROM node:20-alpine AS builder
WORKDIR /app
@ -18,7 +18,7 @@ COPY . .
RUN yarn build
# Production image, copy all the files and run next
FROM node:18-alpine3.19 AS runner
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
@ -40,5 +40,9 @@ EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
ENV NEXT_PUBLIC_SENDGRID_API_KEY=$NEXT_PUBLIC_SENDGRID_API_KEY
ENV NEXT_PUBLIC_RECAPTCHA_SITE_KEY=$NEXT_PUBLIC_RECAPTCHA_SITE_KEY
ENV NEXT_PUBLIC_RECAPTCHA_SECRET_KEY=$NEXT_PUBLIC_RECAPTCHA_SECRET_KEY
CMD ["node", "server.js"]