84 lines
2.2 KiB
YAML
84 lines
2.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
app:
|
|
# Dockerfile here: https://codeberg.org/eotl/open-inventory/src/branch/main/docker/prod/Dockerfile
|
|
image: codeberg.org/eotl/open-inventory:0.0.9
|
|
depends_on:
|
|
- db
|
|
networks:
|
|
- proxy
|
|
- internal
|
|
entrypoint: /abra-entrypoint.sh
|
|
configs:
|
|
- source: entrypoint_conf
|
|
target: /abra-entrypoint.sh
|
|
mode: 0555
|
|
secrets:
|
|
- db_password
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/fpm-ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 1m
|
|
deploy:
|
|
update_config:
|
|
failure_action: rollback
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.docker.network=proxy"
|
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
|
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
|
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
|
- "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
|
|
volumes:
|
|
- mariadb:/var/lib/mysql/
|
|
environment:
|
|
- MYSQL_DATABASE=open-inventory
|
|
- MYSQL_USER=open-inventory
|
|
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
|
secrets:
|
|
- db_password
|
|
- db_root_password
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized"]
|
|
interval: 30s
|
|
timeout: 30s
|
|
retries: 3
|
|
start_period: 1m
|
|
deploy:
|
|
labels: [ 'coop-cloud.${STACK_NAME}.db.version=10.5-31e52f4d87a' ]
|
|
networks:
|
|
- internal
|
|
|
|
volumes:
|
|
mariadb:
|
|
driver: local
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
internal:
|
|
|
|
secrets:
|
|
db_password:
|
|
external: true
|
|
name: ${STACK_NAME}_db_password_${DB_PASSWORD_VERSION}
|
|
db_root_password:
|
|
external: true
|
|
name: ${STACK_NAME}_db_root_password_${DB_ROOT_PASSWORD_VERSION}
|
|
|
|
configs:
|
|
entrypoint_conf:
|
|
# FIXME: use ENTRYPOINT_CONF_VERSION, instead of hardcoded 'v1', ATM, it's failing when using the var
|
|
name: ${STACK_NAME}_entrypoint_conf_v1
|
|
file: entrypoint.sh.tmpl
|
|
template_driver: golang
|