File tree Expand file tree Collapse file tree 3 files changed +37
-13
lines changed Expand file tree Collapse file tree 3 files changed +37
-13
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,3 @@ RUN pip install -e /src
14
14
COPY tests/ /tests/
15
15
16
16
WORKDIR /src
17
- ENV FLASK_APP=allocation/flask_app.py FLASK_DEBUG=1 PYTHONUNBUFFERED=1
18
- CMD flask run --host=0.0.0.0 --port=80
Original file line number Diff line number Diff line change 1
1
build :
2
2
docker-compose build
3
3
4
- api :
5
- docker-compose up -d app
4
+ services :
5
+ docker-compose up -d
6
6
7
7
test :
8
- docker-compose run --rm --entrypoint=' pytest /tests' app
8
+ docker-compose run --rm --entrypoint=' pytest /tests' api
9
9
10
10
unit-tests :
11
- docker-compose run --rm --entrypoint=' pytest /tests/unit' app
11
+ docker-compose run --rm --entrypoint=' pytest /tests/unit' api
12
12
13
13
integration-tests :
14
- docker-compose run --rm --entrypoint=' pytest /tests/integration' app
14
+ docker-compose run --rm --entrypoint=' pytest /tests/integration' api
15
15
16
16
e2e-tests :
17
- docker-compose run --rm --entrypoint=' pytest /tests/e2e' app
17
+ docker-compose run --rm --entrypoint=' pytest /tests/e2e' api
18
18
19
19
logs :
20
- docker-compose logs app | tail -100
20
+ docker-compose logs -- tail=25 api redis_pubsub
21
21
22
22
down :
23
23
docker-compose down --remove-orphans
24
24
25
- all : down build api test
25
+ all : down build services test
Original file line number Diff line number Diff line change 1
1
version : " 3"
2
+
2
3
services :
3
4
4
- app :
5
+ redis_pubsub :
5
6
build :
6
7
context : .
7
8
dockerfile : Dockerfile
9
+ image : allocation-image
8
10
depends_on :
9
11
- postgres
10
12
- redis
11
13
environment :
12
14
- DB_HOST=postgres
13
15
- DB_PASSWORD=abc123
14
- - API_HOST=app
16
+ - REDIS_HOST=redis
15
17
- PYTHONDONTWRITEBYTECODE=1
16
18
volumes :
17
19
- ./src:/src
18
20
- ./tests:/tests
21
+ entrypoint :
22
+ - python
23
+ - /src/allocation/redis_pubsub.py
24
+
25
+ api :
26
+ image : allocation-image
27
+ depends_on :
28
+ - redis_pubsub
29
+ environment :
30
+ - DB_HOST=postgres
31
+ - DB_PASSWORD=abc123
32
+ - API_HOST=api
33
+ - REDIS_HOST=redis
34
+ - PYTHONDONTWRITEBYTECODE=1
35
+ - FLASK_APP=allocation/flask_app.py
36
+ - FLASK_DEBUG=1
37
+ - PYTHONUNBUFFERED=1
38
+ volumes :
39
+ - ./src:/src
40
+ - ./tests:/tests
41
+ entrypoint :
42
+ - flask
43
+ - run
44
+ - --host=0.0.0.0
45
+ - --port=80
19
46
ports :
20
47
- " 5005:80"
21
48
22
-
23
49
postgres :
24
50
image : postgres:9.6
25
51
environment :
You can’t perform that action at this time.
0 commit comments