-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 740 Bytes
/
Dockerfile
File metadata and controls
39 lines (30 loc) · 740 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
35
36
37
38
39
# Use small Alpine Linux image
FROM node:12-alpine
# Set environment variables
ENV PORT=8080
ARG CLIENT_ID
COPY . app/
WORKDIR app/
# Make sure dependencies exist for Webpack loaders
RUN apk add --no-cache \
autoconf \
automake \
bash \
g++ \
libc6-compat \
libjpeg-turbo-dev \
libpng-dev \
make \
nasm
RUN npm cache clean --force && npm ci --only-production --silent
# Build production client side React application
RUN npm run build
# Install pm2
#RUN npm install -g pm2
# Actual script to start can be overridden from `docker run`
#CMD ["pm2", "start", "process.yml", "--no-daemon"]
# Expose port for Node
EXPOSE $PORT
# Start Node server
#ENTRYPOINT npm run prod
CMD ["npm", "run", "prod"]