Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable HTTPS use Custom Certificates #7508

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion docker-compose.https.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@
services:
cvat_server:
labels:
- traefik.http.routers.cvat.tls=true
- traefik.http.routers.cvat.entrypoints=websecure
# for letsencrypt
- traefik.http.routers.cvat.tls.certresolver=lets-encrypt

cvat_ui:
labels:
- traefik.http.routers.cvat-ui.tls=true
- traefik.http.routers.cvat-ui.entrypoints=websecure
# for letsencrypt
- traefik.http.routers.cvat-ui.tls.certresolver=lets-encrypt

traefik:
image: traefik:v2.9
image: traefik:v2.10
container_name: traefik
environment:
TRAEFIK_ENTRYPOINTS_web_ADDRESS: :80
TRAEFIK_ENTRYPOINTS_web_HTTP_REDIRECTIONS_ENTRYPOINT_TO: websecure
TRAEFIK_ENTRYPOINTS_web_HTTP_REDIRECTIONS_ENTRYPOINT_SCHEME: https
TRAEFIK_ENTRYPOINTS_websecure_ADDRESS: :443
# for letsencrypt
TRAEFIK_CERTIFICATESRESOLVERS_lets-encrypt_ACME_EMAIL: "${ACME_EMAIL:?Please set the ACME_EMAIL env variable}"
TRAEFIK_CERTIFICATESRESOLVERS_lets-encrypt_ACME_TLSCHALLENGE: "true"
TRAEFIK_CERTIFICATESRESOLVERS_lets-encrypt_ACME_STORAGE: /letsencrypt/acme.json
Expand All @@ -29,6 +34,10 @@ services:
- 443:443
volumes:
- cvat_letsencrypt:/letsencrypt
# for custom certificates
# volumes:
# - ./certs:/certs
# - ./tls.yml:/etc/traefik/rules/tls.yml

volumes:
cvat_letsencrypt:
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,14 @@ services:
DJANGO_LOG_VIEWER_HOST: grafana
DJANGO_LOG_VIEWER_PORT: 3000

TRAEFIK_ACCESSLOG: true
TRAEFIK_ACCESSLOG_FORMAT: json
# We ought to restrict which fields get logged, so as to avoid redundant information,
# but it doesn't work when configuring with environment variables:
# <https://github.com/traefik/traefik/issues/9755>.
# And we want to use environment variables to allow individual settings to be
# overridden by other Compose files.
TRAEFIK_LOG: true
TRAEFIK_LOG_FORMAT: json
TRAEFIK_ENTRYPOINTS_web_ADDRESS: :8080
TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT: "false"
Expand Down
9 changes: 9 additions & 0 deletions tls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tls:
certificates:
- certFile: /certs/your-crt.pem
keyFile: /certs/your-key.pem
stores:
default:
defaultCertificate:
certFile: /certs/your-crt.pem
keyFile: /certs/your-key.pem