diff --git a/abra.sh b/abra.sh index 8fcf190..5f9e360 100644 --- a/abra.sh +++ b/abra.sh @@ -1,3 +1,8 @@ +ENTRYPOINT_CONF_VERSION=1 + +### Helpers +# these commands can be run via: abra app cmd open-inventory.example.net app $commandName ($commandName: clear_cache, ...) + initial_setup() { cd /app/ diff --git a/compose.yml b/compose.yml index 7d19c32..50566c4 100644 --- a/compose.yml +++ b/compose.yml @@ -2,14 +2,18 @@ version: '3.8' services: app: - # Dockerfile here: + # Dockerfile here: https://codeberg.org/eotl/open-inventory/src/branch/main/docker/prod/Dockerfile image: codeberg.org/eotl/open-inventory:0.0.8 - entrypoint: ./entrypoint.sh depends_on: - db networks: - proxy - internal + entrypoint: /abra-entrypoint.sh + configs: + - source: entrypoint_conf + target: /abra-entrypoint.sh + mode: 0555 environment: - DB_PASSWORD_FILE = /run/secrets/db_password secrets: @@ -32,7 +36,6 @@ services: - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" - "coop-cloud.${STACK_NAME}.version=1.0.0+0.0.5" - db: image: mariadb:10.5 init: true @@ -67,3 +70,9 @@ secrets: db_root_password: external: true name: ${STACK_NAME}_db_root_password_${DB_ROOT_PASSWORD_VERSION} + +configs: + entrypoint_conf: + name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION} + file: entrypoint.sh.tmpl.tmpl + template_driver: golang diff --git a/entrypoint.sh b/entrypoint.sh.tmpl similarity index 63% rename from entrypoint.sh rename to entrypoint.sh.tmpl index 0af6381..97e4574 100644 --- a/entrypoint.sh +++ b/entrypoint.sh.tmpl @@ -3,10 +3,6 @@ # Laravel app (+ nginx) container export DB_PASSWORD=$(cat /run/secrets/db_password) -# DB container -export MYSQL_PASSWORD=$(cat /run/secrets/db_password) -export MYSQL_ROOT_PASSWORD=$(cat /run/secrets/db_root_password) - # Upstream ENTRYPOINT # https://codeberg.org/eotl/open-inventory/src/branch/main/docker/prod/Dockerfile /app/docker/entrypoint.sh