-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (21 loc) · 747 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (21 loc) · 747 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
FROM node:24 AS build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:stable-alpine AS production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
RUN addgroup -S lowgroup && adduser -S lowuser -G lowgroup
RUN mkdir -p /var/cache/nginx/client_temp && \
mkdir -p /var/log/nginx && \
mkdir -p /tmp/nginx && \
chown -R lowuser:lowgroup /var/cache/nginx && \
chown -R lowuser:lowgroup /var/log/nginx && \
chown -R lowuser:lowgroup /usr/share/nginx/html && \
chown -R lowuser:lowgroup /tmp
USER lowuser
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]