-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
46 lines (40 loc) · 1.11 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
version: '3.6'
services:
tests-pg:
image: postgres:$POSTGRES_VERSION
environment:
- 'POSTGRES_DB=$POSTGRES_DB'
- 'POSTGRES_USER=$POSTGRES_USER'
- 'POSTGRES_PASSWORD=$POSTGRES_PASSWORD'
volumes:
- ./docker/pg/create-users.sql:/docker-entrypoint-initdb.d/create-users.sql
ports:
- $POSTGRES_LOCAL_PORT:5432
tests-config:
build:
context: .
dockerfile: Dockerfile
target: app-image
volumes:
- './swpt_login:/usr/src/app/swpt_login'
env_file: .env
environment:
- 'PYTHONDONTWRITEBYTECODE=1'
- 'SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://swpt_login:swpt_login@tests-pg:5432/${POSTGRES_DB}'
command: configure
depends_on:
- tests-pg
tests-flush:
build:
context: .
dockerfile: Dockerfile
target: app-image
volumes:
- './swpt_login:/usr/src/app/swpt_login'
env_file: .env
environment:
- 'PYTHONDONTWRITEBYTECODE=1'
- 'SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://swpt_login:swpt_login@tests-pg:5432/${POSTGRES_DB}'
command: flush
depends_on:
- tests-pg