-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
74 lines (63 loc) · 1.85 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
69
70
71
72
73
74
# Base for final image
FROM debian:bookworm-slim as node-minimal
RUN apt update && \
apt -y dist-upgrade && \
apt -y install nodejs && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# Temporary image to build app
FROM debian:bookworm-slim as builder
RUN apt update && \
apt -y dist-upgrade && \
apt -y install nodejs npm && \
apt autoremove -y && \
apt clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
# COPIES
COPY ./packages/federated-identity-service/server.mjs .
COPY ./packages/crypto ./packages/crypto
COPY ./packages/logger ./packages/logger
COPY ./packages/matrix-resolve ./packages/matrix-resolve
COPY ./packages/matrix-identity-server ./packages/matrix-identity-server
COPY ./packages/config-parser ./packages/config-parser
COPY ./packages/federated-identity-service ./packages/federated-identity-service
COPY ./packages/utils ./packages/utils
COPY .husky .husky
COPY lerna.json ./
COPY tsconfig-build.json ./
COPY rollup-template.js ./
COPY package*.json ./
RUN npm install && npm run build && \
rm -rf node_modules */*/node_modules && \
npm install --production --ignore-scripts && \
npm cache clean --force
FROM node-minimal as federation-server
ENV BASE_URL= \
CRON_SERVICE= \
CROWDSEC_URI= \
DATABASE_ENGINE= \
DATABASE_HOST= \
DATABASE_NAME= \
DATABASE_USER= \
DATABASE_PASSWORD= \
LDAP_BASE= \
LDAP_FILTER= \
LDAP_USER= \
LDAP_PASSWORD= \
LDAP_URI= \
MATRIX_DATABASE_ENGINE= \
MATRIX_DATABASE_HOST= \
MATRIX_DATABASE_NAME= \
MATRIX_DATABASE_PASSWORD= \
MATRIX_DATABASE_USER= \
NODE_EXTRA_CA_CERTS= \
SERVER_NAME= \
TEMPLATE_DIR= \
TRUST_X_FORWARDED_FOR= \
TRUSTED_SERVERS_ADDRESSES=
COPY --from=1 /usr/src/app /usr/src/app/
WORKDIR /usr/src/app
EXPOSE 3000
CMD [ "node", "/usr/src/app/server.mjs" ]