-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile_api
27 lines (24 loc) · 1009 Bytes
/
dockerfile_api
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
FROM node:16.16.0
COPY ./api /home/api
WORKDIR /home/api
#RUN apt-get -y install iptables cron
CMD (which yarn || npm i -g [email protected]) && \
echo "NODE_EN=$NODE_ENV"; \
echo "PE_ENV=$PE_ENV"; \
if [ "$PE_ENV" = "true" ]; then \
export NO_PROXY="localhost,.internal,.intra" ; \
export HTTPS_PROXY="http://host.docker.internal:9000" ; \
export HTTP_PROXY="http://host.docker.internal:9000" ; \
yarn config set https-proxy 'http://host.docker.internal:9000' -g ; \
yarn config set http-proxy 'http://host.docker.internal:9000' -g ; \
yarn config set strict-ssl false ; \
fi; \
yarn install --production=false && \
if [ "$NODE_ENV" = "production" ] || [ "$NODE_ENV" = "recette" ] || [ "$NODE_ENV" = "test" ]; then \
yarn build:production && \
yarn start:production; \
else \
yarn start --verbose; \
fi;
# Utile pour debugguer et rentrer dans le conteneur si celui-ci n'est plus OK
#sleep infinity;