This repository has been archived on 2021-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
foodsoft/compose.yml

180 lines
4.8 KiB
YAML
Raw Permalink Normal View History

2020-10-06 15:11:16 +00:00
version: "3.8"
2021-05-24 08:45:47 +00:00
x-env: &env
DOMAIN:
EMAIL_ERROR:
EMAIL_REPLY_DOMAIN:
EMAIL_SENDER:
FOODCOOP_CITY:
FOODCOOP_COUNTRY:
FOODCOOP_EMAIL:
FOODCOOP_FOOTER:
FOODCOOP_HELP_URL:
FOODCOOP_HOMEPAGE:
FOODCOOP_MULTI_INSTALL:
FOODCOOP_NAME:
FOODCOOP_PHONE:
FOODCOOP_STREET:
FOODCOOP_TIME_ZONE:
FOODCOOP_ZIP_CODE:
LOG_LEVEL:
MYSQL_DB: foodsoft
MYSQL_HOST: db
MYSQL_PORT: 3306
MYSQL_USER: foodsoft
QUEUE: foodsoft_notifier
REDIS_URL: redis://cache:6379
SECRET_KEY_BASE_FILE: /run/secrets/secret_key_base
SMTP_ADDRESS:
SMTP_AUTHENTICATION:
SMTP_DOMAIN:
SMTP_ENABLE_STARTTLS_AUTO:
SMTP_PASSWORD_FILE: /run/secrets/smtp_password
SMTP_PORT:
SMTP_USER_NAME:
x-configs: &configs
2021-05-24 08:22:08 +00:00
- source: app_config
target: /usr/src/app/config/app_config.yml
- source: db_config
target: /usr/src/app/config/database.yml
- source: production_env
target: /usr/src/app/config/environments/production.rb
- source: entrypoint
target: /usr/src/app/docker-entrypoint.sh
mode: 0555
2021-05-24 08:45:47 +00:00
x-secrets: &secrets
2021-05-24 08:22:08 +00:00
- db_password
- secret_key_base
- smtp_password
2020-10-06 15:11:16 +00:00
services:
app:
image: foodcoops/foodsoft:4.7.1
2020-10-06 15:11:16 +00:00
networks:
- internal
- proxy
2021-05-24 08:22:08 +00:00
secrets: *secrets
configs: *configs
entrypoint: &entrypoint /usr/src/app/docker-entrypoint.sh
environment:
!%21merge <<: *env
2021-05-24 08:45:47 +00:00
FOODSOFT_SERVICE: app
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}"
2021-06-08 09:19:05 +00:00
- coop-cloud.${STACK_NAME}.app.version=4.7.1-
2020-10-27 07:47:20 +00:00
cron:
image: foodcoops/foodsoft:4.7.1
environment:
!%21merge <<: *env
2021-05-24 08:45:47 +00:00
FOODSOFT_SERVICE: cron
2021-05-24 08:22:08 +00:00
configs: *configs
entrypoint: *entrypoint
secrets: *secrets
2020-10-06 15:11:16 +00:00
networks:
- internal
2021-06-04 07:02:00 +00:00
deploy:
2021-06-08 09:19:05 +00:00
labels: ['coop-cloud.${STACK_NAME}.cron.version=4.7.1-']
2020-10-27 07:47:20 +00:00
worker:
image: foodcoops/foodsoft:4.7.1
environment:
!%21merge <<: *env
2021-05-24 08:45:47 +00:00
FOODSOFT_SERVICE: worker
2021-05-24 08:22:08 +00:00
configs: *configs
entrypoint: *entrypoint
2021-05-24 08:50:06 +00:00
secrets: *secrets
2020-10-06 15:11:16 +00:00
networks:
- internal
2021-06-04 07:02:00 +00:00
deploy:
2021-06-08 09:19:05 +00:00
labels: ['coop-cloud.${STACK_NAME}.worker.version=4.7.1-']
smtp:
image: foodcoops/foodsoft:4.7.1
2021-05-24 08:22:08 +00:00
configs: *configs
entrypoint: *entrypoint
secrets: *secrets
environment:
!%21merge <<: *env
2021-05-24 08:45:47 +00:00
FOODSOFT_SERVICE: smtp
SMTP_SERVER_HOST:
SMTP_SERVER_PORT:
networks:
2020-11-08 18:55:49 +00:00
- proxy
- internal
2020-11-08 18:49:42 +00:00
deploy:
labels:
- "traefik.enable=true"
2020-11-08 19:22:05 +00:00
- "traefik.tcp.routers.foodsoft-smtp.rule=HostSNI(`*`)"
2020-11-08 19:30:39 +00:00
- "traefik.tcp.routers.foodsoft-smtp.entrypoints=foodsoft-smtp"
2020-11-08 19:22:40 +00:00
- "traefik.tcp.services.foodsoft-smtp.loadbalancer.server.port=${SMTP_SERVER_PORT}"
2021-06-08 09:19:05 +00:00
- coop-cloud.${STACK_NAME}.smtp.version=4.7.1-
2020-10-27 07:47:20 +00:00
db:
2021-05-21 08:05:09 +00:00
image: "mariadb:10.6"
2020-11-08 16:40:46 +00:00
command: "mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_520_ci"
2020-10-06 15:11:16 +00:00
environment:
2021-05-24 08:45:47 +00:00
MYSQL_USER: foodsoft
MYSQL_DATABASE: foodsoft
MYSQL_PASSWORD_FILE: /run/secrets/db_password
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
2020-10-06 15:11:16 +00:00
secrets:
2020-11-02 17:20:13 +00:00
- db_password
- db_root_password
2020-10-06 15:11:16 +00:00
volumes:
2020-11-08 16:40:58 +00:00
- "db:/var/lib/mysql"
2020-10-06 15:11:16 +00:00
networks:
- internal
2021-06-04 07:02:00 +00:00
deploy:
2021-06-08 09:19:05 +00:00
labels: ['coop-cloud.${STACK_NAME}.db.version=10.6-']
2020-10-27 07:45:19 +00:00
cache:
image: "redis:6"
2020-11-01 11:36:16 +00:00
networks:
- internal
2021-06-04 07:02:00 +00:00
deploy:
2021-06-08 09:19:05 +00:00
labels: ['coop-cloud.${STACK_NAME}.cache.version=6-']
2020-10-06 15:11:16 +00:00
networks:
internal:
proxy:
external: true
volumes:
2020-11-08 16:40:58 +00:00
db:
2020-10-06 15:11:16 +00:00
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}
2020-11-02 17:07:53 +00:00
file: entrypoint.sh.tmpl
template_driver: golang
2021-05-23 21:48:57 +00:00
production_env:
name: ${STACK_NAME}_production_env_${PRODUCTION_ENV_VERSION}
file: production.rb.tmpl
template_driver: golang
2020-10-06 15:11:16 +00:00
secrets:
2020-11-02 17:20:13 +00:00
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
2020-10-06 15:11:16 +00:00
external: true
2020-11-02 17:20:13 +00:00
db_root_password:
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
external: true
2020-11-02 17:20:13 +00:00
smtp_password:
2020-11-02 17:07:53 +00:00
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}
external: true
secret_key_base:
name: ${STACK_NAME}_secret_key_base_${SECRET_SECRET_KEY_BASE_VERSION}
external: true