forked from OpenSlides/openslides-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (44 loc) · 1.38 KB
/
Dockerfile
File metadata and controls
61 lines (44 loc) · 1.38 KB
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
ARG CONTEXT=prod
FROM traefik:3.6.0 AS base
## Setup
ARG CONTEXT
WORKDIR /app
ENV APP_CONTEXT=${CONTEXT}
# curl for healthcheck, gettext for templating (envsubst)
RUN apk add --no-cache curl gettext
# Copy configuration files
COPY entrypoint.sh /entrypoint.sh
COPY certs /certs
COPY services /services
COPY templates /templates
# Create dynamic config directory and make entrypoint executable
RUN mkdir -p /etc/traefik/dynamic
RUN chmod +x /entrypoint.sh
# External Information
LABEL org.opencontainers.image.title="OpenSlides Traefik Proxy"
LABEL org.opencontainers.image.description="The Traefik proxy is the entrypoint for traffic going into an OpenSlides instance."
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/OpenSlides/OpenSlides/tree/main/openslides-proxy"
# Health check
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost:8080/ping
# Command
ENTRYPOINT ["/entrypoint.sh"]
COPY ./dev/command.sh ./
RUN chmod +x command.sh
CMD ["./command.sh"]
# Development Image
FROM base AS dev
ENV ENABLE_LOCAL_HTTPS=1
ENV ENABLE_DASHBOARD=1
ENV TRAEFIK_LOG_LEVEL=DEBUG
# Testing Image
FROM base AS tests
# Production Image
FROM base AS prod
# Add appuser for security
RUN adduser -S -D -H appuser
RUN chown -R appuser /app/ && \
chown -R appuser /etc/traefik/ && \
chown appuser /entrypoint.sh
USER appuser