From a26f40acb689ab17f1e491db79e9b47823707c30 Mon Sep 17 00:00:00 2001 From: Petar Kirov Date: Wed, 30 Mar 2022 11:24:37 +0300 Subject: [PATCH] config(docker-compose): Various improvements * Update `tour` service ports to be used with nginx * Remove TLS cert paths as their not used by the tour server * Set DNS addresses * Change watchtower image to `containrrr/watchtower` (the previous one was deprecated) * Share dockerhub credentials with watchtower to avoid rate limiting * Run dummy core-exec and core-dreg services to make their images eligible for update by watchtower * Update `.editorconfig` file to always trim trailing whitespace and treat files as utf-8 --- .editorconfig | 5 ++-- deploy/docker-compose.yml | 52 ++++++++++++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/.editorconfig b/.editorconfig index 8c0c59e7..36106c37 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,17 +5,16 @@ root = true # Unix-style newlines with a newline ending every file [*] +charset = utf-8 end_of_line = lf insert_final_newline = true +trim_trailing_whitespace = true [*.{js,d,css,dt}] charset = utf-8 indent_style = tab indent_size = 4 -trim_trailing_whitespace = true [*.md] -charset = utf-8 -trim_trailing_whitespace = true indent_style = space indent_size = 4 diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index d0fd4754..d8e96f52 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -5,16 +5,56 @@ tour: - /var/run/docker.sock:/var/run/docker.sock - /etc/letsencrypt:/etc/letsencrypt ports: - - "80:8080" - - "443:8443" + - "8080:8080" + - "8443:8443" environment: - GOOGLE_ANALYTICS_ID=UA-76170840-1 - - TLS_CA_CHAIN_FILE=/etc/letsencrypt/live/tour.dlang.io/cert.pem - - TLS_PRIVATE_KEY_FILE=/etc/letsencrypt/live/tour.dlang.io/privkey.pem + - EXEC_DOCKER_MAX_OUTPUT_SIZE=500000 + - GITHUB_TOKEN=_token_ restart: always + dns: + - 8.8.8.8 + - 9.9.9.9 + watchtower: - image: centurylink/watchtower - command: --cleanup + image: containrrr/watchtower + command: --interval 240 --cleanup --debug volumes: - /var/run/docker.sock:/var/run/docker.sock + # Used to avoid Dockerhub API rate limit: + - ~/.docker/config.json:/config.json restart: always + +# Watchtower is only able to update the images of existing containers. If no +# containers (no matter their state) are using a given image, it won't be +# considered for update. +# +# Since the images below are always deleted after execution, we need to create a +# dummy service to "pin" them. +# +# Use `tail -F ` so simulate a 0% cpu usage infinite loop. +# +core-dreg_latest: + image: "dlangtour/core-dreg:latest" + container_name: core-dreg_latest + entrypoint: ['/usr/bin/tail', '-F', 'missing'] +core-exec_dmd: + image: "dlangtour/core-exec:dmd" + container_name: core-exec_dmd + entrypoint: ['/bin/tail', '-F', 'missing'] +core-exec_dmd-beta: + image: "dlangtour/core-exec:dmd-beta" + container_name: core-exec_dmd-beta + entrypoint: ['/bin/tail', '-F', 'missing'] +core-exec_dmd-nightly: + image: "dlangtour/core-exec:dmd-nightly" + container_name: core-exec_dmd-nightly + entrypoint: ['/bin/tail', '-F', 'missing'] +core-exec_ldc: + image: "dlangtour/core-exec:ldc" + container_name: core-exec_ldc + entrypoint: ['/bin/tail', '-F', 'missing'] +core-exec_ldc-beta: + image: "dlangtour/core-exec:ldc-beta" + container_name: core-exec_ldc-beta + entrypoint: ['/bin/tail', '-F', 'missing']