-
Notifications
You must be signed in to change notification settings - Fork 65
/
Dockerfile
48 lines (31 loc) · 958 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
45
46
47
48
FROM node:22-alpine AS base
ENV DOCKER_DEPLOY=true
ENV ALLOW_CONFIG_MUTATIONS=true
RUN apk add --update --no-cache tzdata \
nano \
bash \
htop \
nginx \
nginx-mod-http-lua \
&& cp /usr/share/zoneinfo/UTC /etc/localtime \
&& echo "UTC" > /etc/timezone \
&& mkdir -p /run/nginx
COPY ./nginx.conf /etc/nginx/http.d/default.conf
RUN nginx -t
FROM base AS build
WORKDIR /build
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json tsconfig.build.json ./
COPY config ./config
COPY src ./src
RUN npm run build
FROM base
WORKDIR /server
ARG env
ENV NODE_ENV=${env}
COPY --from=build /build/package.json /build/package-lock.json ./
RUN npm ci --omit=dev
COPY --from=build /build/config ./config
COPY --from=build /build/dist ./dist
CMD nginx; npm run start:build