/
Dockerfile
68 lines (56 loc) · 1.65 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM node:16-slim
# Environment variables default values
ENV NODE_ENV=production
ENV LCK_PORT=8002
ENV LCK_HOST=localhost
ENV LCK_PUBLIC_URL=http://localhost:8002
ENV LCK_PUBLIC_PORTAL_NAME="LocoKit platform"
ENV LCK_AUTH_SECRET=yoursecretforpasswordTOCHANGEABSOLUTELY
ENV LCK_DATABASE_URL=postgres://postgres:lckpassword@localhost:5432/public
ENV OBJECTION_DEBUG=false
ENV MAIL_PORT=
ENV MAIL_SERVER=
ENV MAIL_USERNAME=
ENV MAIL_PASSWORD=
ENV MAIL_DEFAULT_FROM=
ENV MAIL_SECURE=false
ENV SENTRY_DSN=
ENV SENTRY_RELEASE=
ENV SENTRY_ENVIRONMENT=
ENV CORS_ORIGIN=*
ENV HELMET_ENABLED=true
ENV HELMET_HSTS=true
ENV STORAGE_TYPE=fs
ENV STORAGE_FS_PATH=../fs-storage
ENV STORAGE_MAX_UPLOAD_SIZE=20mb
WORKDIR /code
RUN mkdir /code/fs-storage
# Update image and install nano
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get clean all
RUN apt-get autoclean
RUN apt install nano
# Copy all files related to api, front & docs
COPY api/package*.json /code/
COPY api/src /code/src/
COPY api/knexutils /code/knexutils/
COPY api/public/ /code/public/
COPY api/public/index.html /code/public/index-api.html
COPY front/dist /code/public/
COPY front/dist/config-default.js /code/public/config.js
COPY docs/.vitepress/dist /code/public/docs/
COPY api/templates /code/templates/
COPY api/lib /code/lib/
COPY api/config /code/config/
COPY api/migrations /code/migrations/
COPY api/seeds /code/seeds/
COPY api/tsconfig.json /code/
COPY api/knexfile.ts /code/
# Install dependencies
COPY api/patch/ /code/patch/
RUN npm ci --also=dev
RUN npm install pm2 knex typescript -g
# ENTRYPOINT pm2-runtime lib/index.js -n lck-api
WORKDIR /code/
CMD npm run migrate:latest && node /code/lib/index.js