Add framework and apiserver
[pti/o2.git] / docker-compose.yml
1 version: "3"
2
3 services:
4
5   redis_pubsub:
6     build:
7       context: .
8       dockerfile: Dockerfile
9     image: o2imsdms-image
10     depends_on:
11       - postgres
12       - redis
13     environment:
14       - DB_HOST=postgres
15       - DB_PASSWORD=o2ims123
16       - REDIS_HOST=redis
17       - PYTHONDONTWRITEBYTECODE=1
18     volumes:
19       - ./src:/src
20       - ./tests:/tests
21     entrypoint:
22       - python
23       - /src/o2ims/entrypoints/redis_eventconsumer.py
24
25   api:
26     image: o2imsdms-image
27     depends_on:
28       - redis_pubsub
29     environment:
30       - DB_HOST=postgres
31       - DB_PASSWORD=o2ims123
32       - API_HOST=api
33       - REDIS_HOST=redis
34       - PYTHONDONTWRITEBYTECODE=1
35       - FLASK_APP=o2ims/entrypoints/flask_application.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
46     ports:
47       - "5005:80"
48
49   postgres:
50     image: postgres:9.6
51     environment:
52       - POSTGRES_USER=o2ims
53       - POSTGRES_PASSWORD=o2ims123
54     ports:
55       - "54321:5432"
56
57   redis:
58     image: redis:alpine
59     ports:
60       - "63791:6379"