From 78940df2ab6246acac3da7c724699bcd8090312e Mon Sep 17 00:00:00 2001 From: knoflook Date: Thu, 19 Oct 2023 14:52:51 +0200 Subject: [PATCH] wip --- compose.yml | 27 ++++++++++++++++----------- entrypoint.sh => entrypoint.sh.tmpl | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) rename entrypoint.sh => entrypoint.sh.tmpl (95%) diff --git a/compose.yml b/compose.yml index 29e6303..b59e773 100644 --- a/compose.yml +++ b/compose.yml @@ -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: diff --git a/entrypoint.sh b/entrypoint.sh.tmpl similarity index 95% rename from entrypoint.sh rename to entrypoint.sh.tmpl index d99b27f..8d3e29a 100644 --- a/entrypoint.sh +++ b/entrypoint.sh.tmpl @@ -28,4 +28,4 @@ file_env DATABASE_PASSWORD file_env SECRET_KEY file_env SMTP_PASSWORD - +/docker-entrypoint.sh