-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.stack.release.yml
75 lines (73 loc) · 2.53 KB
/
docker-compose.stack.release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: '3.7'
services:
backend:
image: 'openstax/corgi-${DOCKER_IMAGE_BACKEND}:${TAG-latest}'
environment:
- REVISION=${REVISION:?}
- TAG=${TAG:?}
- STACK_NAME=${STACK_NAME:?}
- DEPLOYED_AT=${DEPLOYED_AT}
- POSTGRES_SERVER=${POSTGRES_SERVER:-db}
- POSTGRES_DB=${POSTGRES_DB:-corgi-dev}
- POSTGRES_USER=${POSTGRES_USER:-corgi-dev}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust}
- SQLALCHEMY_POOL_SIZE=20
- SQLALCHEMY_MAX_OVERFLOW=10
- GITHUB_API_TOKEN=${GITHUB_API_TOKEN:?}
- GITHUB_OAUTH_ID=${GITHUB_OAUTH_ID:?}
- GITHUB_OAUTH_SECRET=${GITHUB_OAUTH_SECRET:?}
- SESSION_SECRET=${SESSION_SECRET:?}
- BACKEND_CORS_ORIGINS=http://localhost, http://localhost:3000
deploy:
labels:
- "traefik.http.services.${STACK_NAME:?}_backend.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME:?}_backend.rule=Host(`${DOMAIN:?}`) && (PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`) || PathPrefix(`/openapi.json`))"
- "traefik.http.routers.${STACK_NAME:?}_backend.entrypoints=http"
- "traefik.tags=${TRAEFIK_PUBLIC_TAG:?}"
- "traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK:?}"
- "traefik.enable=true"
replicas: 2
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
logging:
options:
awslogs-stream: "${STACK_NAME:?}_backend"
networks:
- ${TRAEFIK_PUBLIC_NETWORK:?}
- default
frontend:
image: 'openstax/corgi-${DOCKER_IMAGE_FRONTEND:?}:${TAG-latest}'
deploy:
labels:
- "traefik.http.services.${STACK_NAME:?}_frontend.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME:?}_frontend.rule=Host(`${DOMAIN:?}`) && PathPrefix(`/`)"
- "traefik.http.routers.${STACK_NAME:?}_frontend.entrypoints=http"
- "traefik.tags=${TRAEFIK_PUBLIC_TAG:?}"
- "traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK:?}"
- "traefik.enable=true"
replicas: 2
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
logging:
options:
awslogs-stream: "${STACK_NAME:?}_frontend"
networks:
- ${TRAEFIK_PUBLIC_NETWORK:?}
- default
networks:
default:
driver: overlay
internal: true
ipam:
driver: default
config:
- subnet: "${SUBNET:?}"
traefik-public:
external: true