-
Notifications
You must be signed in to change notification settings - Fork 102
/
Dockerfile
66 lines (40 loc) · 1.32 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM node:20-bullseye AS source-light
WORKDIR /build/
COPY ./frontend/package.json .
COPY ./frontend/package-lock.json .
RUN --mount=type=cache,target=/root/.npm \
npm ci --omit=dev
COPY ./frontend/angular.json .
COPY ./frontend/tsconfig.json .
COPY ./frontend/external_modules external_modules
COPY ./frontend/src src
FROM source-light AS source
WORKDIR /build/external_modules/occtax
COPY ./contrib/occtax/frontend/ .
#RUN --mount=type=cache,target=/root/.npm \
# npm ci --omit=dev
WORKDIR /build/external_modules/occhab
COPY ./contrib/gn_module_occhab/frontend/ .
#RUN --mount=type=cache,target=/root/.npm \
# npm ci --omit=dev
WORKDIR /build/external_modules/validation
COPY ./contrib/gn_module_validation/frontend/ .
RUN --mount=type=cache,target=/root/.npm \
npm ci --omit=dev
FROM source-light AS build-light
WORKDIR /build/
RUN npm run build
FROM source AS build
WORKDIR /build/
RUN npm run build
FROM nginx:mainline-alpine AS prod-base
ENV NGINX_PORT 80
ENV NGINX_HOST localhost
ENV NGINX_LOCATION /
COPY ./frontend/50-set-api-endpoint.sh /docker-entrypoint.d/
COPY ./frontend/nginx.conf /etc/nginx/templates/default.conf.template
EXPOSE 80
FROM prod-base AS prod-light
COPY --from=build-light /build/dist /usr/share/nginx/html
FROM prod-base AS prod
COPY --from=build /build/dist /usr/share/nginx/html