-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (33 loc) · 824 Bytes
/
Dockerfile
File metadata and controls
39 lines (33 loc) · 824 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
38
39
# Stage 1 building the code
FROM node:lts-slim as builder
WORKDIR /usr/app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2 final stage with builded code
FROM node:lts-slim
WORKDIR /usr/app
COPY package*.json ormconfig.js ./
RUN npm ci --production
VOLUME /usr/app/upload
VOLUME /usr/app/logs
COPY --from=builder /usr/app/dist ./dist
COPY ./media ./media
ENV JWT_SECRET ='mon-token-secret' \
DB_TYPE='mariadb' \
DB_HOST='localhost' \
DB_PORT=3306 \
DB_DATABASE='dbname' \
DB_USER='user' \
DB_PASSWORD='' \
PORT=3000 \
LOG_LEVEL='debug' \
ENDPOINT_PREFIX='' \
NODE_ENV='production'\
SENDGRID_API_KEY=''\
SENDGRID_SEND_EMAIL=''\
SENDGRID_REPLY_EMAIL=''\
RECAPTCHA_KEY=''
EXPOSE 3000
CMD node dist/app.js