forked from tkosminov/nestjs-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (27 loc) · 946 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM mhart/alpine-node:12 as builder
# Env
ARG env
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
# Timezone
RUN apk update
RUN apk add --update tzdata && \
cp /usr/share/zoneinfo/UTC /etc/localtime && \
echo "UTC" > /etc/timezone
# Nginx
RUN apk add --update --no-cache nginx && \
mkdir -p /run/nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Apk
RUN apk add --update --no-cache --virtual runtime-deps \
nano \
postgresql-client \
readline \
bash \
htop
WORKDIR /server
COPY . .
RUN HUSKY_SKIP_INSTALL=true npm install
ENV NODE_ENV ${env}
RUN npm run build
EXPOSE 80
CMD nginx; node ./dist/main.js