-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (48 loc) · 1.1 KB
/
docker-compose.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
version: '3'
services:
app:
build:
context: .
dockerfile: front-end/Dockerfile
image: ghcr.io/christianfosli/snake/wasm-app
environment:
API_URL: http://api:3000
ports:
- '8080:80'
depends_on:
- api
api:
build:
context: .
dockerfile: highscore-api/Dockerfile
image: ghcr.io/christianfosli/snake/highscore-api
environment:
DB_CONNSTR: mongodb://root:secret@db
ports:
- '3000:3000'
depends_on:
db:
condition: service_healthy
cleanup-job:
build:
context: .
dockerfile: highscore-cleanup-job/Dockerfile
image: ghcr.io/christianfosli/snake/highscore-cleanup-job
environment:
DB_CONNSTR: mongodb://root:secret@db
depends_on:
db:
condition: service_healthy
db:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
expose:
- '27017'
volumes:
- snake-db:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
volumes:
snake-db: