-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (40 loc) · 1.17 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
# Builder
FROM alpine:3.21.2 AS builder
WORKDIR /app
# Packages
RUN apk add --no-cache findutils
# Get Leaflet
ARG LEAFLET_URL="https://github.com/Leaflet/Leaflet/releases/download/v1.9.3/leaflet.zip"
RUN wget -O /tmp/leaflet.zip "$LEAFLET_URL" && \
unzip /tmp/leaflet.zip -d /tmp/leaflet
RUN mkdir -p assets/leaflet && \
cp -r \
/tmp/leaflet/leaflet.css \
/tmp/leaflet/leaflet.js \
/tmp/leaflet/leaflet.js.map \
/tmp/leaflet/images/ \
assets/leaflet/
RUN find /app -type d -exec chmod 755 {} \; && \
find /app -type f -exec chmod 644 {} \;
# Release
FROM nginx:1.27.3-alpine AS release
# Workdir
WORKDIR /app
# Copy files
COPY --from=builder /app/assets/ /app/assets/
COPY index.html /app/index.html
COPY nginx.conf /etc/nginx/nginx.conf
COPY entrypoint.sh /docker-entrypoint.d/50-entrypoint.sh
# Permissions
RUN chmod +x /docker-entrypoint.d/50-entrypoint.sh
RUN chmod 644 /app/index.html
# Environment
ENV READSB_HOST="readsb" \
READSB_PORT="8042" \
PAGE_TITLE="Readsb Web" \
REFRESH_RATE="250" \
CENTER_LAT="45.0" \
CENTER_LNG="9.0" \
CENTER_RADIUS="500"
# Healthcheck
HEALTHCHECK CMD curl --fail http://localhost/ || exit 1