-
Notifications
You must be signed in to change notification settings - Fork 46
/
docker-compose.yml
68 lines (63 loc) · 1.83 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
version: "2"
services:
lb:
# The load balancer container. Built from the lb/Dockerfile.
container_name: idb_lb
build: lb
restart: unless-stopped
networks:
- backend
ports:
- "80:80"
image: cs373sweg/idb_lb
app:
# The app container. Built from the app/Dockerfile.
build: app
restart: unless-stopped
networks:
backend:
aliases:
# All app servers be referred to by this alias with the backend network
- apps
environment:
# Environment variables to configure the app on startup.
- MYSQL_DATABASE=cars_db
- MYSQL_HOST=sweetrides
image: cs373sweg/idb_app
expose:
# Expose port 8000 so it's only visibile on the container, not the host
- "8000"
env_file: idb-mysql.env
command: gunicorn app:app --bind 0.0.0.0:8000
db:
# The database container. Built from the db/Dockerfile.
container_name: idb_db
build: db
restart: unless-stopped
networks:
- backend
environment:
# Environment variables to configure MySQL on startup.
- MYSQL_DATABASE=sweetrides
image: cs373sweg/idb_db
expose:
# Expose port 3306 so it's only visibile on the container, not the host
- "3306"
env_file:
- idb-mysql.env
- idb-mysql-root.env
volumes_from:
# Mount the volumes from the data container to store our MySQL files
- data
data:
container_name: idb_db_data
# The Data Volume Container used to mount a volume to store our persistent data
# https://getcarina.com/docs/tutorials/data-volume-containers/
image: cirros
volumes:
# Mount this path as a volume to store our MySQL files
- /var/lib/mysql
command: /bin/true
# Run a trivial command to exit quickly. Volumes don't need a running container.
networks:
backend: {}