-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (28 loc) · 878 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
FROM docker.io/node:20-alpine as build-develop
WORKDIR /app/src
ADD ./ /app/src/
RUN npm clean-install
RUN npm run build-develop
# develop nginx container
FROM docker.io/nginx:mainline as develop
ADD .docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-develop /app/src/dist/ /var/www/
EXPOSE 80/tcp
FROM docker.io/node:20-alpine as build-stage
WORKDIR /app/src
ADD ./ /app/src/
RUN npm clean-install
RUN npm run build-stage
FROM docker.io/nginx:mainline as stage
ADD .docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /app/src/dist/ /var/www/
EXPOSE 80/tcp
FROM docker.io/node:20-alpine as build-main
WORKDIR /app/src
ADD ./ /app/src/
RUN npm clean-install
RUN npm run build-main
FROM docker.io/nginx:mainline as main
ADD .docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-main /app/src/dist/ /var/www/
EXPOSE 80/tcp