-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
86 lines (78 loc) · 2.68 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
version: '3.8'
# In the docker compose file, we define a number of services (containers) we want to run.
services:
# We want to run MariaDB as a database server
mariadb:
image: mariadb:10.10
environment: # Configuration of the database server as specified in their README
MYSQL_ROOT_PASSWORD: ${DATABASE_ROOT_PASSWORD:?}
MYSQL_DATABASE: ${DATABASE_NAME:?}
MYSQL_USER: ${DATABASE_USER:?}
MYSQL_PASSWORD: ${DATABASE_PASSWORD:?}
ports: # We expose the database on the port specified in the .env file
- ${DATABASE_PORT:-3306}:3306
volumes:
# We store the database files in ./data/db in our repository
- ./data/db:/var/lib/mysql
# We mount the SQL dump files in ./data/sql to automatically seed the database
- "./data/sql:/docker-entrypoint-initdb.d"
restart: always
# Service specification for the .NET Core-based backend
backend-dotnet:
image: webeng-tutorial/backend-dotnet
build: # We specify how to build the image name given above: by building the Dockerfile in the directory specified
context: ./backend-dotnetcore
depends_on: # The backend can only run when the database is up
- mariadb
environment:
- ConnectionStrings__DefaultConnection=server=mariadb;port=3306;database=${DATABASE_NAME:?};user=${DATABASE_USER:?};password=${DATABASE_PASSWORD:?}
ports: # We expose this backend on the port specified in the .env file
- ${BACKEND_DOTNET_PORT:?}:80
# Service specification for the Node/ExpressJS-based backend
backend-express:
image: webeng-tutorial/backend-express
build:
context: ./backend-express
depends_on:
- mariadb
environment:
- DATABASE_HOST=mariadb
- DATABASE_USER=${DATABASE_USER:?}
- DATABASE_PASSWORD=${DATABASE_PASSWORD:?}
- DATABASE_NAME=${DATABASE_NAME:?}
- DATABASE_PORT=3306
ports:
- ${BACKEND_EXPRESS_PORT:?}:80
# Service specification for the Vanilla frontend
frontend-vanilla:
image: webeng-tutorial/frontend-vanilla
build:
context: ./frontend-vanilla
ports:
- ${FRONTEND_VANILLA_PORT:?}:80
environment:
- BACKENDS
frontend-bootstrap:
image: webeng-tutorial/frontend-bootstrap
build:
context: ./frontend-bootstrap
ports:
- ${FRONTEND_BOOTSTRAP_PORT:?}:80
environment:
- BACKENDS
frontend-react:
image: webeng-tutorial/frontend-react
build:
context: ./frontend-react
ports:
- ${FRONTEND_REACT_PORT:?}:80
environment:
- BACKENDS
frontend-vue:
image: webeng-tutorial/frontend-vue
build:
context: ./frontend-vue
ports:
- ${FRONTEND_VUE_PORT:?}:80
environment:
- BACKENDS