astro-payload-test/docker-compose.prod.yml

100 lines
2.7 KiB
YAML
Raw Normal View History

2024-05-17 22:32:32 +00:00
---
version: "3.8"
services:
app:
image: nginx:1.26.0
networks:
- proxy
volumes:
- html_content:/usr/share/nginx/html
configs:
2024-05-17 22:41:23 +00:00
- source: nginx_conf
2024-05-17 22:45:32 +00:00
target: /etc/nginx/nginx.conf
2024-05-17 22:32:32 +00:00
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}-astro.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}-astro.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-astro.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-astro.tls.certresolver=production"
payload:
2024-05-18 04:14:02 +00:00
image: git.autonomic.zone/autonomic-cooperative/astro-payload-test-payload:latest
2024-05-17 22:32:32 +00:00
environment:
- "NAME=${STACK_NAME}"
2024-05-18 16:35:41 +00:00
- "PAYLOAD_URL"
2024-05-17 22:32:32 +00:00
- "PAYLOAD_PORT=3001"
- "PAYLOAD_SECRET_FILE=/run/secrets/payload_secret"
- "MONGODB_USER=mongo"
- "MONGODB_HOST=${STACK_NAME}_mongo"
- "MONGODB_PORT=27017"
- "MONGODB_PASSWORD_FILE=/run/secrets/mongo_password"
- "TOKEN_FILE=/run/secrets/token"
2024-05-18 04:13:19 +00:00
- "REPOSITORY"
2024-05-17 22:32:32 +00:00
secrets:
- mongo_password
- payload_secret
- token
2024-05-18 16:44:33 +00:00
volumes:
2024-05-18 16:51:26 +00:00
- payload_uploads:/prod/dist/media
2024-05-17 22:32:32 +00:00
networks:
- proxy
- internal
deploy:
update_config:
failure_action: rollback
order: start-first
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}-payload.loadbalancer.server.port=3001"
# FIXME switch to /admin probably using PathPrefix
- "traefik.http.routers.${STACK_NAME}-payload.rule=Host(`admin.${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-payload.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-payload.tls.certresolver=production"
mongo:
image: mongo:6.0.5
restart: unless-stopped
volumes:
- mongo:/data/db
command:
- --storageEngine=wiredTiger
environment:
- "MONGO_INITDB_ROOT_USERNAME=mongo"
- "MONGO_INITDB_ROOT_PASSWORD_FILE=/run/secrets/mongo_password"
secrets:
- mongo_password
networks:
- internal
networks:
proxy:
external: true
internal:
secrets:
payload_secret:
external: true
name: ${STACK_NAME}_payload_secret_${SECRET_PAYLOAD_SECRET_VERSION}
token:
external: true
name: ${STACK_NAME}_token_${SECRET_TOKEN_VERSION}
mongo_password:
external: true
name: ${STACK_NAME}_mongo_password_${SECRET_MONGO_PASSWORD_VERSION}
volumes:
mongo:
html_content:
2024-05-18 16:44:33 +00:00
payload_uploads:
2024-05-17 22:32:32 +00:00
configs:
nginx_conf:
name: ${STACK_NAME}_nginx_conf_${NGINX_CONF_VERSION}
file: astro/nginx.conf
template_driver: golang