-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
96 lines (90 loc) · 2.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
96 lines (90 loc) · 2.48 KB
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
services:
nginx:
image: ghcr.io/equinor/template-fastapi-react/nginx:latest
restart: unless-stopped
build:
target: nginx-prod
context: ./web
tmpfs:
- /var/cache/nginx:uid=65532,gid=65532
- /run/nginx:uid=65532,gid=65532
ports:
- "80:8080"
depends_on:
- api
- oauth2
api:
image: ghcr.io/equinor/template-fastapi-react/api
build:
context: ./api
target: prod
restart: unless-stopped
env_file:
- .env
depends_on:
db:
condition: service_healthy
environment:
OTEL_SERVICE_NAME: template-fastapi-react-api
MONGODB_HOSTNAME: db
MONGODB_PORT: "27017"
MONGODB_DATABASE: ${MONGODB_DATABASE:-test}
MONGODB_USERNAME: ${MONGODB_USERNAME:-root}
MONGODB_PASSWORD: ${MONGODB_PASSWORD:-mongodb}
db:
image: mongo:7.0.30
restart: unless-stopped
command: mongod --auth --quiet
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME:-root}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD:-mongodb}
healthcheck:
test:
- CMD
- mongosh
- --quiet
- --eval
- "db.adminCommand({ ping: 1 }).ok"
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
oauth2:
image: ghcr.io/equinor/template-fastapi-react/oauth2:latest
build: ./web/oauth2
restart: unless-stopped
env_file:
- .env
depends_on:
- cookie-cache
secrets:
- oauth2-client-secret
- cookie-cache-password
- oauth2-cookie-secret
environment:
# Wired to docker secrets (file paths inside the container, not values).
CLIENT_SECRET_FILE: /run/secrets/oauth2-client-secret
OAUTH2_PROXY_REDIS_PASSWORD_FILE: /run/secrets/cookie-cache-password
OAUTH2_PROXY_COOKIE_SECRET_FILE: /run/secrets/oauth2-cookie-secret
# Local-only redirect
OAUTH2_PROXY_REDIRECT_URL: http://localhost/oauth2/callback
cookie-cache:
image: ghcr.io/equinor/template-fastapi-react/redis:latest
build:
context: ./redis
restart: unless-stopped
volumes:
- cookie_cache_data:/data
secrets:
- cookie-cache-password
environment:
REDIS_PASSWORD_FILE: /run/secrets/cookie-cache-password
volumes:
cookie_cache_data:
secrets:
oauth2-client-secret:
file: secrets/OAUTH2_CLIENT_SECRET.txt
cookie-cache-password:
file: secrets/COOKIE_CACHE_PASSWORD.txt
oauth2-cookie-secret:
file: secrets/OAUTH2_PROXY_COOKIE_SECRET.txt