-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (30 loc) · 796 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
38
39
FROM node:14.17.1 as base
# Add package file
COPY package*.json ./
# Install server deps
RUN npm i
# Create dirs
RUN mkdir client
# Copy source
COPY server.js ./
COPY api ./api
COPY client/package.json ./client
COPY client/jsconfig.json ./client
COPY client/.env ./client
COPY client/src ./client/src
COPY client/public ./client/public
# Install client deps
RUN npm run client:modules
# Build dist
RUN npm run client:build
# Start production image build
FROM gcr.io/distroless/nodejs:14
# Copy node modules and build directory
COPY --from=base ./node_modules ./node_modules
COPY --from=base /server.js ./
COPY --from=base /api /api
COPY --from=base /client/build /client/build
COPY --from=base /client/src/constants /client/src/constants
# Expose port 3001
EXPOSE 3001
CMD ["server.js"]