-
Notifications
You must be signed in to change notification settings - Fork 107
/
Dockerfile
36 lines (24 loc) · 952 Bytes
/
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
# Dockerfile for Threema Web, based on the nginx alpine image.
#
# WARNING: This Dockerfile does not include TLS termination. Make sure to run
# the container behind a reverse proxy (e.g. Nginx) that does proper
# TLS termination.
# First, build Threema Web in a node container
FROM docker.io/node:18 AS builder
ENV NODE_ENV=production
COPY . /opt/threema-web/
WORKDIR /opt/threema-web/
RUN sed -i "s/SELF_HOSTED: [^,]*,/SELF_HOSTED: true,/g" src/config.ts
RUN npm ci
RUN npm run dist -- d
# Then, transfer the build artifacts to a minimal nginx container
FROM docker.io/nginx:1.23-alpine
RUN apk add --update bash
RUN rm /usr/share/nginx/html/*
COPY --from=builder /opt/threema-web/release/threema-web-* /usr/share/nginx/html/
COPY docker/entrypoint.sh /usr/local/bin/
EXPOSE 80
# Set better defaults for production
ENV VISUALIZE_STATE=false \
CONSOLE_LOG_LEVEL=info
CMD ["/bin/bash", "/usr/local/bin/entrypoint.sh"]