aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar wookie184 <[email protected]>2023-04-22 13:31:26 +0100
committerGravatar GitHub <[email protected]>2023-04-22 13:31:26 +0100
commit0ad9c1866f7b268be01226369542f4e8f4de939c (patch)
treefe09e0245a8c0bd2b92eedffb24b08cd4f598a83
parentRemove !close command from helpers. (#2548) (diff)
parentRemove check-yaml unsafe arg (diff)
Merge pull request #2554 from python-discord/update-docker-compose
Use documented spec extensions in docker compose
-rw-r--r--.pre-commit-config.yaml1
-rw-r--r--docker-compose.yml43
2 files changed, 18 insertions, 26 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 511de28c7..b5a7f3dce 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -5,7 +5,6 @@ repos:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- args: [--unsafe] # Required due to custom constructors (e.g. !ENV)
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
diff --git a/docker-compose.yml b/docker-compose.yml
index f0f393d68..8b4c6b0a3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,22 +2,16 @@
# the bot project relies on for testing. Use it if you haven't got a
# ready-to-use site environment already setup.
-version: "3.7"
-
-x-logging: &logging
- logging:
- driver: "json-file"
- options:
- max-file: "5"
- max-size: "10m"
-
-x-restart-policy: &restart_policy
- restart: unless-stopped
+x-logging: &default-logging
+ driver: "json-file"
+ options:
+ max-file: "5"
+ max-size: "10m"
services:
postgres:
- << : *logging
- << : *restart_policy
+ logging : *default-logging
+ restart: unless-stopped
image: postgres:15-alpine
environment:
POSTGRES_DB: pysite
@@ -30,15 +24,14 @@ services:
retries: 5
redis:
- << : *logging
- << : *restart_policy
+ logging : *default-logging
+ restart: unless-stopped
image: redis:5.0.9
ports:
- "127.0.0.1:6379:6379"
metricity:
- << : *logging
- << : *restart_policy
+ logging : *default-logging
restart: on-failure # USE_METRICITY=false will stop the container, so this ensures it only restarts on error
depends_on:
postgres:
@@ -53,8 +46,8 @@ services:
- .:/tmp/bot:ro
snekbox:
- << : *logging
- << : *restart_policy
+ logging : *default-logging
+ restart: unless-stopped
image: ghcr.io/python-discord/snekbox:latest
init: true
ipc: none
@@ -65,8 +58,8 @@ services:
- "3.10"
snekbox-311:
- << : *logging
- << : *restart_policy
+ logging : *default-logging
+ restart: unless-stopped
image: ghcr.io/python-discord/snekbox:3.11-dev
init: true
ipc: none
@@ -75,8 +68,8 @@ services:
privileged: true
web:
- << : *logging
- << : *restart_policy
+ logging : *default-logging
+ restart: unless-stopped
image: ghcr.io/python-discord/site:latest
command: ["run", "--debug"]
networks:
@@ -97,8 +90,8 @@ services:
STATIC_ROOT: /var/www/static
bot:
- << : *logging
- << : *restart_policy
+ logging : *default-logging
+ restart: unless-stopped
build:
context: .
dockerfile: Dockerfile