-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (23 loc) · 768 Bytes
/
Dockerfile
File metadata and controls
37 lines (23 loc) · 768 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
FROM node:24.13.0-alpine AS builder
USER node
RUN mkdir /home/node/web
WORKDIR /home/node/web
COPY --chown=node:node package.json package-lock.json /home/node/web/
ENV NODE_ENV=production
RUN npm ci
COPY --chown=node:node . /home/node/web
RUN npx next build
FROM nginx:1.28.0-alpine
COPY --from=builder /home/node/web/out /var/www
COPY nginx.conf /etc/nginx/nginx.conf
## add permissions for nginx user
RUN chown -R nginx:nginx /var/www && chmod -R 755 /var/www && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chown -R nginx:nginx /etc/nginx/conf.d
RUN touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid
USER nginx
STOPSIGNAL SIGQUIT
EXPOSE 8000 8001
CMD ["nginx", "-g", "daemon off;"]