-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-common.yml
50 lines (45 loc) · 1.38 KB
/
docker-compose-common.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
version: "2"
# A Docker Compose file for common configuration between development and production environments
services:
lb:
# The load balancer container. Built from the lb/Dockerfile.
container_name: cs373idb_lb
build: lb
restart: unless-stopped
networks:
- backend
ports:
- "80:80"
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=ibdb
- MYSQL_HOST=cs373idb_db
db:
# The database container. Built from the db/Dockerfile.
container_name: cs373idb_db
build: db
restart: unless-stopped
networks:
- backend
environment:
# Environment variables to configure MySQL on startup.
- MYSQL_DATABASE=ibdb
data:
container_name: cs373idb_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.