-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (31 loc) · 871 Bytes
/
Dockerfile
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
40
41
42
43
44
45
46
47
# Build stage
FROM node:22-alpine AS build
WORKDIR /app
# Ensure correct ownership
# Run as root to fix permissions first
USER root
# Ensure directories exist and set proper ownership
#RUN mkdir -p /app/user-sessions /app/.dist && \
# chown -R pptruser:pptruser /app && \
# chmod -R 777 /app/.dist /app/user-sessions
#
#USER pptruser
COPY package*.json .
RUN npm install
COPY . .
RUN npm run build
# Production stage
FROM node:22-alpine AS production
WORKDIR /app
# Ensure directory exists with correct permissions
USER root
# Ensure directories exist and set proper ownership
#RUN mkdir -p /app/user-sessions /app/.dist && \
# chown -R pptruser:pptruser /app && \
# chmod -R 777 /app/.dist /app/user-sessions
#
#USER pptruser
COPY package*.json .
RUN npm install --production
COPY --from=build /app/.dist ./.dist
CMD ["node", ".dist/app.js"]