-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
37 lines (34 loc) · 964 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
27
28
29
30
31
32
33
34
35
36
37
FROM node:17.8-alpine3.15 AS base
ENV NODE_ENV=production
WORKDIR /base
COPY package*.json ./
RUN npm ci
COPY . .
FROM base AS build
ARG BUILD_DATE
ARG TC_BUILD
ARG CONTENT_API
ARG NEXT_PUBLIC_FEEDBACK_API
ENV NEXT_PUBLIC_BUILD_DATE=$BUILD_DATE
ENV NEXT_PUBLIC_FEEDBACK_API=$NEXT_PUBLIC_FEEDBACK_API
RUN echo $NEXT_PUBLIC_BUILD_DATE
ENV NEXT_PUBLIC_TC_BUILD=$TC_BUILD
ENV NEXT_CONTENT_API=$CONTENT_API
ENV NODE_ENV=production
WORKDIR /build
COPY --from=base /base ./
RUN npm run build
FROM node:17.8-alpine3.15 AS production
ENV NODE_ENV=production
ENV REPORT_A_PROBLEM_ENABLED=true
ENV NOTIFY_BASE_API_URL=https://api.notification.canada.ca
ENV NOTIFY_API_KEY=""
ENV NOTIFY_REPORT_A_PROBLEM_EMAIL=""
ENV NOTIFY_REPORT_A_PROBLEM_TEMPLATE_ID=""
WORKDIR /app
COPY --from=build /build/package*.json ./
COPY --from=build /build/next.config.js ./
COPY --from=build /build/public ./public
COPY --from=build /build/.next ./.next
RUN npm install next
CMD npm run start