-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile
50 lines (32 loc) · 1.01 KB
/
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
48
49
50
FROM node:20-alpine AS server-dependencies
WORKDIR /app
COPY server/package.json server/package-lock.json ./
RUN npm install npm@latest --global
RUN npm install pnpm --global
RUN pnpm import
RUN pnpm install --prod
FROM node:20-alpine AS client
WORKDIR /app
COPY client/package.json client/package-lock.json ./
RUN npm install npm@latest --global
RUN npm install pnpm --global
RUN pnpm import
RUN pnpm install --prod
COPY client .
RUN DISABLE_ESLINT_PLUGIN=true npm run build
FROM node:20-alpine
RUN apk -U upgrade
RUN apk add bash --no-cache
USER node
WORKDIR /app
COPY --chown=node:node --chmod=775 start.sh .
COPY --chown=node:node server .
RUN mv .env.sample .env
COPY --from=server-dependencies --chown=node:node /app/node_modules node_modules
COPY --from=client --chown=node:node /app/build public
COPY --from=client --chown=node:node /app/build/index.html views/index.ejs
VOLUME /app/public/user-avatars
VOLUME /app/public/project-background-images
VOLUME /app/private/attachments
EXPOSE 1337
CMD ["./start.sh"]