-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 692 Bytes
/
Dockerfile
File metadata and controls
36 lines (24 loc) · 692 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
FROM node:10.15.1-alpine
# Update latest security patches
RUN apk update && apk upgrade
# RUN adduser webuser -
RUN adduser -D -g '' webuser
# SET default APP_DIR path
ARG APP_DIR=/src/app
# Create APP_DIR path and set permissions
RUN mkdir -p $APP_DIR
RUN chown -R webuser:webuser $APP_DIR
# Switch user to non-privileged user
USER webuser
# Change working directory to application directory
WORKDIR $APP_DIR
# Copy package.json to /app directory
COPY package.json .
# Install node modules/dependencies
RUN npm install
# Copy application code
COPY . .
# Expose this port on DOCKER NETWORK (NOT HOST MAPPING)
EXPOSE 8080
# Start the Express server
CMD ["node", "./deploy-prod.js"]