-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (25 loc) · 857 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM node:14 as dependencies
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
FROM node:14 as builder
RUN apt-get update && \
apt-get install -y gettext-base
ARG ENV
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY . .
# RUN yarn build-$ENV && \
# export $(grep -v '^#' .env.$ENV | xargs) && \
# envsubst "`printf '${%s} ' $(env | grep 'CACHE_REDIS' | cut -d'=' -f1)`" < .next-boost.js.docker > .next-boost.js
RUN yarn build-$ENV
FROM node:14 as runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/.next-boost.js ./.next-boost.js
COPY --from=builder /app/next.config.js ./next.config.js
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
CMD yarn start