-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
50 lines (44 loc) · 1.29 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.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
extra_hosts:
- 'host.docker.internal:host-gateway'
env_file: .env
environment:
- 'SOLVER_POSTGRES_URL=postgresql+psycopg://swpt_solver:swpt_solver@tests-pg:5432/${POSTGRES_DB}'
- 'WORKER_POSTGRES_URL=postgresql+psycopg://swpt_worker:swpt_worker@tests-pg:5432/${POSTGRES_DB}'
- 'PYTHONDONTWRITEBYTECODE=1'
command: configure
depends_on:
- tests-pg
tests-web:
build:
context: .
dockerfile: Dockerfile
target: app-image
extra_hosts:
- 'host.docker.internal:host-gateway'
env_file: .env
environment:
- 'WEBSERVER_PORT=8080'
- 'SOLVER_POSTGRES_URL=postgresql+psycopg://swpt_solver:swpt_solver@tests-pg:5432/${POSTGRES_DB}'
- 'PYTHONDONTWRITEBYTECODE=1'
ports:
- $WEBSERVER_PORT:8080
command: develop-run-flask
depends_on:
- tests-pg