-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
77 lines (77 loc) · 3.49 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
# This setup creates a Tomcat container for the EARS webservices, a Tomcat containber for the acquisition module and a MySQL container. If this is the first run it populates it with the needed tables.
# The computer they are run from is called the host.
# The tomcat container depends on the mysql one (see the depends_on keyword).
# The tomcat main command (catalina.sh) is not run before the MySQL database is populated; this is done via the wait_for_mysql.sh script.
# Both containers share the same IP address (localhost). This is done as localhost is hardcoded inside the swing java code
# The SQL data is persisted outside of the MySQL container
# The 'restart: always' keywords ensure that both services are restarted always after each crash or system reboot, as long as the docker daemon is running. sudo docker stop <id> will actually stop the application, and it will not be restarted automatically.
# The container names are stored as ears-server_tomcat, ears-server_mysql and ears-server_acquisition. These can be used in your docker host to see the logs or get info: eg. sudo docker logs ears-server_acquisition or sudo docker inspect ears-server_mysql
# The EARS webservices are reachable on http://localhost and the acquisition server on http://localhost:8080
version: '3.5'
services:
tomcat:
build: .
container_name: "ears-server_tomcat"
# logging:
# driver: "syslog"
environment:
- EARS_JDBC_URL=jdbc:mysql://localhost:3306/casino
- EARS_DB_CLASS=com.mysql.cj.jdbc.Driver
- EARS_DB_USER=${EARS_DB_USER}
- EARS_DB_PASS=${EARS_DB_PASS}
- ACQUISITION_JDBC_URL=jdbc:mysql://localhost:3306/casino
- ACQUISITION_DB_CLASS=com.mysql.cj.jdbc.Driver
- ACQUISITION_DB_USER=${ACQUISITION_DB_USER}
- ACQUISITION_DB_PASS=${ACQUISITION_DB_PASS}
depends_on:
- "mysql"
network_mode: "service:mysql"
# needed because tomcat and mysql need to be on the same server container
command: ["./wait-for-mysql.sh", mysql, "3306", "root", "wzka684l7i", "casino", "catalina.sh", "run"]
restart: always
volumes:
- ./setenv.sh:/usr/local/tomcat/bin/setenv.sh
- ./ontologies:/var/www/ears2
- ./context.xml:/usr/local/tomcat/conf/context.xml
- ./ears2.war:/usr/local/tomcat/webapps/ears2.war
- ./ears2Nav.war:/usr/local/tomcat/webapps/ears2Nav.war
- ./ears2Ont.war:/usr/local/tomcat/webapps/ears2Ont.war
mysql:
image: mariadb:10.4.7-bionic
container_name: "ears-server_mysql"
ports:
- 3307:3306
- ${EARS_PORT}:8080
environment:
- MYSQL_DATABASE=casino
- MYSQL_ROOT_PASSWORD=wzka684l7i
- MYSQL_ROOT_HOST=%
- MYSQL_PASSWORD=casino
- MYSQL_USER=casino
volumes:
- ./ears_ddl.sql:/docker-entrypoint-initdb.d/ears_ddl.sql
- ./ears_mysql_data:/var/lib/mysql
restart: always
acquisition:
build:
context: ./Acquisition_System/bin
container_name: "ears-server_acquisition"
# logging:
# driver: "syslog"
network_mode: "host"
#integrate with host to receive udp
ports:
- ${ACQUISITION_PORT}:8080
environment:
- ACQUISITION_DATABASE_SERVER=${mysql}
- ACQUISITION_DATABASE_PORT=3307
- ACQUISITION_DB_USER=${ACQUISITION_DB_USER}
- ACQUISITION_DB_PASS=${ACQUISITION_DB_PASS}
- NTP_HOST=${NTP_HOST}
volumes:
# - ./acquisition-db:/acquisition/log # for some reason this never works
- ./netcdf:/acquisition/log/test/netcdf
depends_on:
- "mysql"
command: ./startup.sh all
restart: always