This commit is contained in:
knoflook 2023-10-19 14:52:51 +02:00
parent 66193db1b6
commit 78940df2ab
2 changed files with 17 additions and 12 deletions

View File

@ -45,6 +45,10 @@ services:
- source: geoip_conf
target: /etc/GeoIP.conf
mode: 0555
- source: entrypoint
entrypoint: /custom-entrypoint.sh
mode: 0555
entrypoint: /custom-entrypoint.sh
secrets:
- db_password
- secret_key
@ -86,14 +90,8 @@ services:
start_period: 45s
deploy:
labels:
- "coop-cloud.${STACK_NAME}.version=0.1.0+0.1.0"
command: >
sh -c "
echo 'Updating geoip data, first time could be slow...' &&
geoipupdate &&
python karrot-backend.pyz migrate &&
python karrot-backend.pyz server
"
- "coop-cloud.${STACK_NAME}.version=0.1.1+0.1.1"
worker:
image: "ghcr.io/karrot-dev/karrot-docker-images:0.1.1-backend"
depends_on:
@ -104,6 +102,11 @@ services:
volumes:
- "shiv_data:/root/.shiv"
- "geoip_data:/var/lib/GeoIP"
configs:
- source: entrypoint
entrypoint: /custom-entrypoint.sh
mode: 0555
entrypoint: /custom-entrypoint.sh
networks:
- internal
secrets:
@ -118,6 +121,7 @@ services:
- SMTP_USE_TLS
- SMTP_PORT
- SMTP_PASSWORD_FILE=/run/secrets/smtp_password
- IS_WORKER=1
- LISTEN_HOST=0.0.0.0
- LISTEN_SERVER=uvicorn
- SECRET_KEY_FILE=/run/secrets/secret_key
@ -129,9 +133,6 @@ services:
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_DB=0
command:
sh -c "
python karrot-backend.pyz worker"
redis:
image: "redis:6-alpine"
@ -174,6 +175,10 @@ configs:
name: ${STACK_NAME}_geoip_conf_${GEOIP_CONFIG_VERSION}
file: geoip.conf.tmpl
template_driver: golang
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
secrets:
db_password:

View File

@ -28,4 +28,4 @@ file_env DATABASE_PASSWORD
file_env SECRET_KEY
file_env SMTP_PASSWORD
/docker-entrypoint.sh