-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
87 lines (81 loc) · 2.82 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
87
version: '3.2'
services:
# frontend_angular is a web server that provides the JS to the clients.
frontend_angular:
build:
context: ./
dockerfile: ./frontend_angular/Dockerfile
args:
# SSO (ours is CAS) URL for logging out.
SSO_LOGOUT: "https://cas.minet.net/logout"
# SSO URL for getting a token.
SSO_AUTHORIZE: "https://cas.minet.net/oauth2.0/authorize"
# URL of ADH6, the SSO will redirect to that URL after login.
ADH6_URL: "https://localhost/" # Do not forget the trailing slash!
expose:
- "8443" # app does not start as root here
volumes:
# Make a bind mount so you can modify files in the container
- type: bind
source: "./frontend_angular/src"
target: "/adh6/frontend_angular/src/"
read_only: true
# These are files that are generated in the dockerfile that should not be
# read from the host disk.
- "/adh6/frontend_angular/src/app/config"
# api_server is the API that actually does action on the database.
api_server:
build:
context: ./
dockerfile: ./api_server/Dockerfile
args:
# The API will make a request to this URL to verify the authetication token.
CAS_PROFILE_URL: "https://cas.minet.net/oauth2.0/profile"
# This is the configuration of the Database that the API will use.
DATABASE_HOST: "database"
DATABASE_PORT: "3306"
DATABASE_USERNAME: "adh6"
DATABASE_PASSWORD: "adh6_pass"
DATABASE_DB_NAME: "adh6" # Database name.
links:
- database
expose:
- "443"
environment:
ENVIRONMENT: "dev"
volumes:
# Make a bind mount so you can modify files in the container
- type: bind
source: "./api_server/src"
target: "/adh6/api_server/src/"
read_only: true
# The reverse proxy is used to gather the api and the frontend behind the same
# host. We can also use it to cache requests.
reverse_proxy:
build:
context: "./reverse_proxy"
args:
ADH6_URL: "localhost" # Host of the reverse proxy.
# adh6.minet.net/api/... requests will be redirected to this IP/host + port.
API_HOST: "api_server"
API_PORT: "443"
# adh6.minet.net/... requests will be proxied to this IP/host + port.
FRONTEND_HOST: "frontend_angular"
FRONTEND_PORT: "8443"
links:
- frontend_angular
- api_server
ports:
- "443:443"
- "80:80" # Redirect to 443.
command: ['nginx-debug', '-g', 'daemon off;'] # More logging!
# The RDBMS of the project.
database:
build: "database"
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "adh6"
MYSQL_USER: "adh6"
MYSQL_PASSWORD: "adh6_pass" # Please change this password on prod'.
expose:
- "3306"