-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.stack.hotdog.yml
113 lines (106 loc) · 3.73 KB
/
docker-compose.stack.hotdog.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
version: '3.7'
services:
backend:
volumes:
- hotdog:/persist
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.http.routers.${STACK_NAME:?}_backend.service=${STACK_NAME:?}_backend"
- "traefik.http.services.${STACK_NAME:?}_hotdog.loadbalancer.server.port=3000"
- "traefik.http.routers.${STACK_NAME:?}_hotdog.rule=Host(`${DOMAIN:?}`) && PathPrefix(`/hotdog`)"
- "traefik.http.routers.${STACK_NAME:?}_hotdog.entrypoints=http"
- "traefik.http.routers.${STACK_NAME:?}_hotdog.service=${STACK_NAME:?}_hotdog"
- "traefik.http.routers.${STACK_NAME:?}_hotdog.middlewares=${STACK_NAME:?}_hotdog_stripprefix"
- "traefik.http.middlewares.${STACK_NAME:?}_hotdog_stripprefix.stripprefix.prefixes=/hotdog"
- "traefik.tags=${TRAEFIK_PUBLIC_TAG:?}"
- "traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK:?}"
- "traefik.enable=true"
replicas: 1
restart_policy:
condition: on-failure
update_config:
delay: 10s
parallelism: 1
environment:
BACKEND_CORS_ORIGINS: http://localhost, http://localhost:3000
POSTGRES_DB: corgi_hotdog
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_PASSWORD: ''
POSTGRES_SERVER: db
POSTGRES_USER: postgres
REVISION: ${REVISION:?}
STACK_NAME: ${STACK_NAME:?}
TAG: ${TAG:?}
DEPLOYED_AT: ${DEPLOYED_AT}
GITHUB_API_TOKEN: ${GITHUB_API_TOKEN:?}
GITHUB_OAUTH_ID: ${GITHUB_OAUTH_ID:?}
GITHUB_OAUTH_SECRET: ${GITHUB_OAUTH_SECRET:?}
SESSION_SECRET: ${SESSION_SECRET:?}
BUNDLE_PATH: /persist/bundle.json
CORGI_REPO: https://github.com/openstax/corgi
HOTDOG_FRONTEND_PORT: 8080
PATH_PREFIX: /hotdog
image: openstax/corgi-backend:${TAG:?}
logging:
options:
awslogs-stream: "${STACK_NAME:?}_backend"
command: ./bin/prestart-hotdog.sh
networks:
- ${TRAEFIK_PUBLIC_NETWORK:?}
- default
db:
deploy:
placement:
constraints:
- node.labels.app-db-data == true
- node.role == manager
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_DB: corgi_hotdog
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_PASSWORD: ''
POSTGRES_SERVER: db
POSTGRES_USER: postgres
REVISION: ${REVISION:?}
STACK_NAME: ${STACK_NAME:?}
TAG: ${TAG:?}
DEPLOYED_AT: ${DEPLOYED_AT}
SQLALCHEMY_POOL_SIZE: 20
SQLALCHEMY_MAX_OVERFLOW: 10
image: postgres:12
logging:
options:
awslogs-stream: "${STACK_NAME:?}_db"
frontend:
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: 1
restart_policy:
condition: on-failure
update_config:
delay: 10s
parallelism: 1
environment:
DEPLOYED_IN: "hotdog"
image: openstax/corgi-frontend:${TAG:?}
logging:
options:
awslogs-stream: "${STACK_NAME:?}_frontend"
networks:
- ${TRAEFIK_PUBLIC_NETWORK:?}
- default
volumes:
hotdog:
networks:
traefik-public:
external: true
name: traefik-public