Dockerfile 938 B

1234567891011121314151617181920212223242526272829303132
  1. # Dockerfile for Threema Web, based on the nginx alpine image.
  2. #
  3. # WARNING: This Dockerfile does not include TLS termination. Make sure to run
  4. # the container behind a reverse proxy (e.g. Nginx) that does proper
  5. # TLS termination.
  6. # First, build Threema Web in a node container
  7. FROM node:10 AS builder
  8. ENV NODE_ENV=production
  9. COPY . /opt/threema-web/
  10. WORKDIR /opt/threema-web/
  11. RUN sed -i "s/SELF_HOSTED: [^,]*,/SELF_HOSTED: true,/g" src/config.ts
  12. RUN npm ci
  13. RUN npm run dist -- d
  14. # Then, transfer the build artifacts to a minimal nginx container
  15. FROM nginx:1.15-alpine
  16. RUN rm /usr/share/nginx/html/*
  17. COPY --from=builder /opt/threema-web/release/threema-web-* /usr/share/nginx/html/
  18. COPY docker/entrypoint.sh /usr/local/bin/
  19. ENV SALTYRTC_HOST="" \
  20. SALTYRTC_PORT=443 \
  21. SALTYRTC_SERVER_KEY="b1337fc8402f7db8ea639e05ed05d65463e24809792f91eca29e88101b4a2171"
  22. CMD ["/bin/sh", "/usr/local/bin/entrypoint.sh"]