-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.backend
35 lines (30 loc) · 1.06 KB
/
Dockerfile.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
# Copyright(c) 2022 aasaam software development group
FROM node:18-bullseye-slim
ARG PROXY_HTTP
ADD app/api /app/api
RUN export DEBIAN_FRONTEND=noninteractive ; \
export LANG=en_US.utf8 ; \
export LC_ALL=C.UTF-8 ; \
export HTTP_PROXY=$PROXY_HTTP ; \
export HTTPS_PROXY=$PROXY_HTTP ; \
echo "You are using proxy: $PROXY_HTTP"; \
apt-get update -y \
&& apt-get autoremove -y \
&& apt-get -y upgrade && apt-get install -y --no-install-recommends curl ca-certificates golang-cfssl p7zip-full \
&& curl -sf https://gobinaries.com/tj/node-prune | sh \
&& npm -g update \
&& npm -g install npm \
&& npm -g install pm2 \
&& node-prune /usr/local/lib/node_modules \
&& apt-get purge curl -y \
&& apt-get clean \
&& apt-get autoremove -y \
&& cd /app/api \
&& npm install --production --force \
&& node-prune \
&& rm -rf /usr/local/bin/node-prune \
&& rm -r /var/lib/apt/lists/* && rm -rf /tmp && mkdir /tmp && chmod 777 /tmp && truncate -s 0 /var/log/*.log
EXPOSE 3001/tcp
STOPSIGNAL SIGTERM
WORKDIR /app/api
CMD ["pm2-runtime", "pm2.prod.config.js"]