Skip to content

Commit

Permalink
config(docker-compose): Various improvements
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
PetarKirov committed Mar 30, 2022
1 parent 91cbef3 commit a26f40a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
52 changes: 46 additions & 6 deletions deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <any missing file>` 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']

0 comments on commit a26f40a

Please sign in to comment.