This repository has been archived by the owner on Aug 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.cross
70 lines (49 loc) · 2.18 KB
/
Dockerfile.cross
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
67
68
69
#########################
### build environment ###
#########################
FROM __BASEIMAGE_ARCH__/node:11-__NODE_TAG__ as builder
__CROSS_COPY qemu/qemu-__QEMU_ARCH__-static /usr/bin/qemu-__QEMU_ARCH__-static
WORKDIR /app
# make local @angular/cli binaries available
ENV PATH=${PATH}:./node_modules/@angular/cli/bin/
# install and cache app dependencies
COPY ["package.json", "yarn.lock", "/app/"]
RUN yarn install
# copy sources to app directory
COPY . .
# build the angular app in production mode and store the artifacts in dist folder
RUN ng --version
RUN yarn build --configuration=docker --progress --verbose
##################
### production ###
##################
FROM __BASEIMAGE_ARCH__/nginx:__NGINX_TAG__
ENV ADA_APPLICATION_TITLE="Feuerwehr Alarm Info Display" \
# timeout to change from alarminfo page to common info page; unit is milliseconds
ADA_ALARMINFO_TIMEOUT=60000 \
# google maps key (see https://developers.google.com/maps/documentation/javascript/get-api-key)
ADA_GOOGLE_MAPS_KEY="AIzaSyCxA9zyYW8cK3Ys4HpG_xIP3V3HxQ-3msQ" \
ADA_GOOGLE_CALENDAR_ID="[email protected]" \
# dataserver endpoint
ADA_DATASERVER_URL="http://localhost" \
ADA_DATASERVER_PORT=9002 \
ADA_DATASERVER_REST_RESOURCE_CURRENT_ALARM_INFO="/current-alarm-info" \
ADA_DATASERVER_WEBSOCKET_ALARM_INFO_EVENT_KEY="ws-alarm-info" \
# Navigation start point e.g. the local firedepartement
ADA_NAVIGATION_START_POINT_LAT="49.526558948981595" \
ADA_NAVIGATION_START_POINT_LNG="10.483931601047516"
__CROSS_COPY qemu/qemu-__QEMU_ARCH__-static /usr/bin/qemu-__QEMU_ARCH__-static
RUN apk add --no-cache bash 2>/dev/null || apt install bash 2>/dev/null
# copy script to replace config placeholders with docker environment ones
COPY startup.sh replace_environment_configs.sh /
RUN chmod +x /replace_environment_configs.sh && \
chmod +x /startup.sh
# copy our default nginx config
COPY nginx/default.conf /etc/nginx/conf.d/
# remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
# copy artifact build from the 'build stage'
COPY --from=builder /app/dist /usr/share/nginx/html
# expose port 80
EXPOSE 80
ENTRYPOINT [ "/startup.sh" ]