-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (22 loc) · 707 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (22 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#STAGE_BUILD
FROM node:17-alpine as build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . /app
RUN npm run build
#STAGE_SERVER
FROM nginx:1.21.6-alpine as server
LABEL maintainer="Aleksandr Sham"
LABEL version="1.0"
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist/angular-starter /usr/share/nginx/html
# add permissions for nginx user
RUN chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chown -R nginx:nginx /etc/nginx/conf.d && \
chown -R nginx:nginx /etc/nginx/nginx.conf && \
touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid
# switch to non-root user
USER nginx