-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
41 lines (37 loc) · 1.01 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
version: "3.8"
services:
app:
build: .
container_name: app
volumes:
- .:/app
ports:
- 8000:8000
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
- TEST_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${TEST_POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
depends_on:
- db
- testdb
db:
image: postgres:alpine
container_name: db
ports:
- 5433:5432 # <host_port>:<container_port>
volumes:
- pgdata:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
testdb:
image: postgres:alpine
container_name: testdb
ports:
- 5434:5432 # <host_port>:<container_port>
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
pgdata: