-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (91 loc) · 2.61 KB
/
Copy pathdocker-compose.yml
File metadata and controls
97 lines (91 loc) · 2.61 KB
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
89
90
91
92
93
94
95
96
97
services:
python_app:
build: .
command: /bin/sh -c "python /app/src/server/yahoo/yahoo_db.py && sleep infinity && sleep infinity || sleep infinity"
volumes:
- ./setup/requirements_app.txt:/app/requirements.txt
- ./setup.py:/app/setup.py
- ./src/:/app/src/
- ./docker-compose.yml:/app/docker-compose.yml
ports:
- "5000:5000"
depends_on:
- db
environment:
- FLASK_RUN_HOST=0.0.0.0
- PYTHONPATH="$PYTHONPATH:/app/:/app/src/"
networks:
custom_network:
ipv4_address: 172.20.0.2
django_app:
build: .
command: /bin/sh -c "chmod +x /app/django_project/run.sh && sleep 5 && /app/django_project/run.sh || sleep infinity"
volumes:
- ./setup/requirements_django.txt:/app/requirements.txt
- ./django_project:/app/django_project
- ./src:/app/src/
- ./docker-compose.yml:/app/docker-compose.yml
- ./tmp_data:/app/tmp_data/
- ./docs:/app/docs
ports:
- "8000:8000"
depends_on:
- db
environment:
- FLASK_RUN_HOST=0.0.0.0
- PYTHONPATH="$PYTHONPATH:/app/:/app/src/"
networks:
custom_network:
ipv4_address: 172.20.0.3
redis:
image: redis:latest
ports:
- "6379:6379"
volumes:
- ./setup/conf/redis.conf:/usr/local/etc/redis/redis.conf
- ./tmp_data/logs/redis:/var/log/redis
command: sh -c " mkdir -p /var/log/redis && touch /var/log/redis/redis-server.log && redis-server /usr/local/etc/redis/redis.conf "
networks:
custom_network:
ipv4_address: 172.20.0.4
#db dose not have to be started see condtional code #todo latter add a try catch. mongo is atm mandetory :)
db:
image: mysql:latest
restart: always
environment:
MYSQL_DATABASE: 'mydatabase'
MYSQL_USER: 'myuser'
MYSQL_PASSWORD: 'mypassword'
MYSQL_ROOT_PASSWORD: 'myrootpassword'
ports:
- '3306:3306'
volumes:
- my-db:/var/lib/mysql
# Add new users to db (? feature for spliting the user for django and data ?)
#- ./data/mysql:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 1m
timeout: 10s
retries: 3
networks:
custom_network:
ipv4_address: 172.20.0.5
test:
build: .
#command: python -m unittest tests
command: bash -c "python -m unittest discover -s tests"
volumes:
- .:/app
- ./requirements.txt:/app/requirements.txt
depends_on:
- db
networks:
custom_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
my-db:
mongo-data: