forked from freeCodeCamp/chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.Dockerfile
More file actions
35 lines (24 loc) · 765 Bytes
/
client.Dockerfile
File metadata and controls
35 lines (24 loc) · 765 Bytes
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
FROM node:16-alpine as development
WORKDIR /usr/chapter/
FROM development as build
ARG NEXT_PUBLIC_DEPLOYMENT_ENVIRONMENT=production
ARG NEXT_PUBLIC_USE_AUTH0=true
ARG NEXT_PUBLIC_AUTH0_DOMAIN
ARG NEXT_PUBLIC_AUTH0_CLIENT_ID
ARG NEXT_PUBLIC_AUTH0_AUDIENCE
ARG NEXT_PUBLIC_SERVER_URL
ARG NEXT_PUBLIC_CLIENT_URL
COPY client ./client
COPY common ./common
COPY package*.json ./
RUN npm ci -w=client --ignore-scripts
RUN npm -w=client run build
FROM development as production
COPY --from=build /usr/chapter/client/.next ./client/.next
COPY client/public ./client/public
COPY package*.json ./
COPY client/package.json ./client/package.json
RUN npm ci -w=client --ignore-scripts --omit=dev
EXPOSE 3000
WORKDIR /usr/chapter/client
CMD [ "npm", "run", "start" ]