-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (19 loc) · 840 Bytes
/
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
FROM node:16
# Built by deploy-node-app
WORKDIR /app
ENV NODE_ENV="production"
ENV GRPC_HEALTH_PROBE_VERSION="v0.3.1"
# Add common build depsk
RUN apt-get update && apt-get install -yqq nginx && \
sed -i 's/root \/var\/www\/html/root \/app\/build/' /etc/nginx/sites-enabled/default && \
chown -R node /app /home/node /etc/nginx /var/log/nginx /var/lib/nginx /usr/share/nginx && \
rm -rf /var/lib/apt/lists/*
USER root
COPY . .
RUN npm i -g @nestjs/cli@7.5.1
RUN yarn && nest build && cp src/orders/orders.proto dist/orders/orders.proto
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.1 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe
EXPOSE 3000
CMD ["node", "dist/main.js"]