-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.label-backend
57 lines (42 loc) · 1.79 KB
/
Dockerfile.label-backend
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
FROM node:16-alpine as label-backend
# ARG http_proxy
# ARG https_proxy
ENV API_PORT=55430
# Use proxy
# RUN yarn config set proxy $http_proxy; \
# yarn config set https-proxy $https_proxy;
WORKDIR /home/node/
# Install git for sder and sder-core package
RUN apk add git
# Copy context files
COPY ./package.json ./
COPY packages/generic/core/package.json ./packages/generic/core/
COPY packages/generic/backend/package.json ./packages/generic/backend/
COPY packages/courDeCassation/package.json ./packages/courDeCassation/
COPY packages/generic/sso/package.json ./packages/generic/sso/
COPY ./sso_files ./sso_files/
COPY . .
# Exclure les dépendances inutiles pour le backend prod
RUN cat package.json | sed 's|"packages/generic/\*"|"packages/generic/backend", "packages/generic/core", "packages/generic/sso"|' > package.json.new && \
mv package.json.new package.json
# Install dependencies
RUN yarn install --production
# RUN yarn install --pure-lockfile
# Compilation explicite des packages nécessaires
# RUN cd packages/generic/sso && yarn compile
# RUN cd packages/generic/core && yarn compile
# RUN cd packages/generic/backend && yarn compile
# RUN cd packages/courDeCassation && yarn compile
# ADD packages/generic/core packages/generic/core
# ADD packages/generic/backend packages/generic/backend
# ADD packages/courDeCassation packages/courDeCassation
# ADD packages/generic/sso packages/generic/sso
# RUN yarn build
# Vérification que le fichier compilé existe
RUN ls -la packages/courDeCassation/dist/ || (echo "Erreur: dist/ est manquant" && exit 1)
RUN chown node .
USER node
# Expose the listening port of your app
EXPOSE ${API_PORT}
# Lancement avec vérification
CMD ["sh", "-c", "RUN_MODE=PROD node packages/courDeCassation/dist/labelServer.js -s packages/courDeCassation/settings/settings.json"]