-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
70 lines (64 loc) · 1.56 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: "3"
services:
database:
image: "postgres:alpine"
restart: always
# Set the database to use POSTGRES_PORT
command: -p ${POSTGRES_PORT}
# Forward from POSTGRES_PORT on the host to POSTGRES_PORT on the container
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
volumes:
# Use database_volume to store the data
- database_volume:/var/lib/postgresql/data
# Execute the database/init scripts on startup
- ./database/init:/docker-entrypoint-initdb.d
redis:
image: "redis:alpine"
restart: always
# Set Redis to use REDIS_PORT
command: --port ${REDIS_PORT}
# Forward from REDIS_PORT on the host to REDIS_PORT on the container
ports:
- ${REDIS_PORT}:${REDIS_PORT}
api:
build:
context: .
dockerfile: api/Dockerfile
depends_on:
- database
- redis
ports:
- ${API_PORT}:${API_PORT}
environment:
- POSTGRES_HOST=database
- POSTGRES_PORT
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- REDIS_HOST=redis
- REDIS_PORT
- API_PORT
matchstarter:
build:
context: .
dockerfile: matchstarter/Dockerfile
depends_on:
- database
- redis
environment:
- POSTGRES_HOST=database
- POSTGRES_PORT
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- REDIS_HOST=redis
- REDIS_PORT
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
database_volume: