forked from HemmeligOrg/Hemmelig.app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (27 loc) · 757 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
# Bare minimum run
# ------------------------------
# $ docker run -p 3000:3000 -d --name=hemmelig \
# -v ./data/hemmelig/:/var/tmp/hemmelig/upload/files \
# -v ./database/:/home/node/hemmelig/database/ \
# hemmeligapp/hemmelig:v5.0.0
FROM node:18-alpine
WORKDIR /usr/src/app
COPY package*.json vite.config.js ./
RUN npm install
COPY . .
ENV NODE_ENV=production
RUN npm run build
# Get ready for step two of the docker image build
FROM node:18-alpine
WORKDIR /home/node/hemmelig
RUN mkdir build
COPY --from=0 /usr/src/app/build build/
COPY package*.json ./
RUN npm ci --production --ignore-scripts
RUN chown -R node.node ./
COPY . .
RUN npx prisma generate
EXPOSE 3000
ENV NODE_ENV=production
USER node
CMD ["npm", "run", "start"]