This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-ci.yml
88 lines (80 loc) · 1.83 KB
/
docker-compose-ci.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
version: "3.9"
services:
db:
image: postgres
container_name: dtd_postgres
# Not persisting data intentionally.
# volumes:
# - ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
expose:
- "5432"
ports:
- "5433:5432"
redis:
image: redis:alpine
container_name: dtd_redis
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- "6380:6380"
command: redis-server --port 6380
source:
build: .
container_name: dtd_source
entrypoint: ["/bin/sh","-c"]
command:
- |
apt update
apt install findutils
find source -path "*/migrations/*.py" -not -name "__init__.py" -delete
find source -path "*/migrations/*.pyc" -delete
find source -path "*/db.sqlite3" -delete
python source/manage.py makemigrations
python source/manage.py migrate
cd source && python -m app.scripts.script && cd ..
python source/manage.py runserver 0.0.0.0:4000
volumes:
- ./source:/code/source
ports:
- "4000:4000"
depends_on:
- redis
- db
target:
build: .
container_name: dtd_target
entrypoint: ["/bin/sh","-c"]
command:
- |
python target/manage.py runserver 0.0.0.0:5000
volumes:
- ./target:/code/target
ports:
- "5000:5000"
depends_on:
- redis
- db
- source
test:
build: .
container_name: dtd_test
entrypoint: ["/bin/sh","-c"]
command:
- |
pip install -r requirements-dev.txt
black . --check
isort . --check
pytest tests/integration_tests.py -s -v
volumes:
- ./:/code/
ports:
- "6000:6000"
depends_on:
- redis
- db
- source
- target