blob: eaa1cb7af18d5f7ec2dd8ba8ae8bc458435f263d [file] [log] [blame]
mesaja80ec5d2025-06-10 17:04:30 +02001# syntax=docker/dockerfile:1
2#######################################################################################
3# Copyright ETSI Contributors and Others.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14# implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#######################################################################################
18
19
20#######################
21# Stage 1: Base stage #
22#######################
23
24FROM node:14-slim AS base
25# placeholder
26
27FROM base AS deps
28
29WORKDIR /app
30
31COPY package*.json ./
32RUN npm i && \
33 npm ci && \
34 npm install -g @angular/cli@15.2.10
35
36
37###############################################################################################################################################################################
38
39########################
40# Stage 2: Build stage #
41########################
42
43# Build stage
44FROM base AS build
45WORKDIR /app
46
47# IMPORTANT: Add node_modules to your .dockerignore file
48# to avoid overwriting the node_modules from the deps stage.
49COPY --from=deps /app/node_modules ./node_modules
50COPY . .
51RUN npm run build
52
53
54##########################################################################################################################################################################
55
56##########################
57# Stage 3: Runtime stage #
58##########################
59
60# Runtime stage
61FROM nginx:alpine
62WORKDIR /usr/share/nginx/html
63
64# Copy nginx config file
65COPY --from=build /app/nginx/nginx.conf /etc/nginx/conf.d/default.conf
66
67# Cleaning up and copying static assets
68RUN rm -rf ./*
69COPY --from=build /app/dist/osm .
70
71EXPOSE 80
72
73HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \
74 CMD curl --silent --fail localhost:80 || exit 1
75
76
77ENTRYPOINT ["nginx", "-g", "daemon off;"]
78