-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
41 lines (41 loc) · 1.18 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
version: '2'
# Create networks to be used to isolate containers
networks:
# Server network to hold database and backend
servernetwork: {}
# Create named volumes to mount to containers.
volumes:
# Create a named volume to hold database data
database-storage: {}
# Define services to be run.
services:
database:
build: ./database
volumes:
- database-storage:/var/lib/mysql
environment:
# Since we didn't set any password, default root password is empty.
# Make sure Mariadb accepts the empty password and runs.
- MYSQL_ALLOW_EMPTY_PASSWORD=1
ports:
# Expose the Mysql port for local development.
# This is so we can connect to the database using `localhost` or the ip of the docker host.
- "3306:3306"
networks:
# Add the database service to the servernetwork.
- servernetwork
application:
build:
context: ./application
dockerfile: development.Dockerfile
volumes:
- ./application:/application/code
env_file:
# Get the configuration from the dotenv file.
- ./application/.example.env
ports:
- "8080:8080"
networks:
- servernetwork
depends_on:
- database