foodsoft/compose.yml

144 lines
3.6 KiB
YAML
Raw Normal View History

2020-10-06 15:11:16 +00:00
---
version: "3.8"
services:
app:
image: "foodcoops/foodsoft:4.7.0"
2020-10-06 15:11:16 +00:00
networks:
- internal
- proxy
secrets:
- db_passwd
- shared_lists_db_passwd
2020-11-01 09:45:01 +00:00
configs:
2020-11-01 11:00:18 +00:00
- source: app_config
target: /usr/src/app/config/app_config.yml
- source: db_config
target: /usr/src/app/config/database.yml
- source: entrypoint
target: /usr/src/app/docker-entrypoint.sh
mode: 0555
entrypoint: /usr/src/app/docker-entrypoint.sh
environment:
- DOMAIN
- EMAIL_ERROR
- EMAIL_REPLY
- EMAIL_SENDER
- FOODCOOP_CITY
- FOODCOOP_COUNTRY
- FOODCOOP_EMAIL
- FOODCOOP_FOOTER
- FOODCOOP_HELP_URL
- FOODCOOP_HOMEPAGE
- FOODCOOP_NAME
- FOODCOOP_PHONE
- FOODCOOP_STREET
- FOODCOOP_TIME_ZONE
- FOODCOOP_ZIP_CODE
2020-11-01 11:36:16 +00:00
- MAILER_PREFIX=foodsoft+
- MYSQL_HOST=db
- MYSQL_NAME=foodsoft
- MYSQL_PORT=3306
- MYSQL_USER=foodsoft
- QUEUE=foodsoft_notifier
2020-11-01 11:36:16 +00:00
- REDIS_URL=redis://cache:6379
- SECRET_KEY_BASE_FILE=/var/run/secrets/secret_key_base
- SHARED_LISTS_DB_NAME
- SHARED_LISTS_DB_TYPE
- SHARED_LISTS_HOST
- SHARED_LISTS_USER
2020-11-01 11:36:16 +00:00
- SMTP_ADDRESS
- SMTP_DOMAIN
- SMTP_PASSWORD_FILE=/var/run/secrets/smtp_passwd
2020-11-01 11:36:16 +00:00
- SMTP_PORT
- SMTP_USER_NAME
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 15s
timeout: 10s
retries: 10
start_period: 1m
2020-10-06 15:11:16 +00:00
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.routers.foodsoft.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.foodsoft.entrypoints=web-secure"
- "traefik.http.services.foodsoft.loadbalancer.server.port=3000"
- "traefik.http.routers.foodsoft.tls.certresolver=${LETS_ENCRYPT_ENV}"
2020-10-06 15:11:16 +00:00
2020-10-27 07:47:20 +00:00
cron:
image: "foodcoops/foodsoft:4.7.0"
2020-10-06 15:11:16 +00:00
command: ./proc-start cron
networks:
- internal
2020-10-27 07:47:20 +00:00
worker:
image: "foodcoops/foodsoft:4.7.0"
2020-10-06 15:11:16 +00:00
command: ./proc-start worker
networks:
- internal
2020-10-27 07:47:20 +00:00
db:
2020-10-06 15:11:16 +00:00
image: "mariadb:10.5"
command: |
mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
- MYSQL_DATABASE=foodsoft
- MYSQL_USER=foodsoft
- MYSQL_PASSWORD_FILE=/run/secrets/db_passwd
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_passwd
secrets:
- db_passwd
- db_root_passwd
volumes:
- "database:/var/lib/mysql"
networks:
- internal
2020-10-27 07:45:19 +00:00
cache:
image: "redis:6"
2020-11-01 11:36:16 +00:00
networks:
- internal
2020-10-06 15:11:16 +00:00
networks:
internal:
proxy:
external: true
volumes:
database:
configs:
app_config:
name: ${STACK_NAME}_app_config_${APP_CONFIG_VERSION}
2020-10-06 15:11:16 +00:00
file: app_config.yml.tmpl
template_driver: golang
db_config:
name: ${STACK_NAME}_db_config_${DB_CONFIG_VERSION}
file: database.yml.tmpl
template_driver: golang
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.yml.tmpl
template_driver: golang
2020-10-06 15:11:16 +00:00
secrets:
db_passwd:
name: ${STACK_NAME}_db_passwd_${DB_PASSWORD_VERSION}
2020-10-06 15:11:16 +00:00
external: true
db_root_passwd:
name: ${STACK_NAME}_db_root_passwd_${DB_ROOT_PASSWD_VERSION}
external: true
shared_lists_db_passwd:
name: ${STACK_NAME}_shared_lists_db_passwd_${SHARED_LISTS_DB_PASSWD_VERSION}
2020-10-06 15:11:16 +00:00
external: true
smtp_passwd:
name: ${STACK_NAME}_smtp_password_${SMTP_PASSWD_VERSION}
external: true
secret_key_base:
name: ${STACK_NAME}_secret_key_base_${SECRET_KEY_BASE_VERSION}
external: true