summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bentele2021-06-01 10:28:06 +0200
committerManuel Bentele2021-06-01 10:53:00 +0200
commitee31aa4a3e44eb60261e39e6ca62a62325f1cded (patch)
treefa23b526965ccaa81e35b8af22653fa0c14fe5d5
parentUpdate testdata for master-server database (diff)
downloadmasterserver-ee31aa4a3e44eb60261e39e6ca62a62325f1cded.tar.gz
masterserver-ee31aa4a3e44eb60261e39e6ca62a62325f1cded.tar.xz
masterserver-ee31aa4a3e44eb60261e39e6ca62a62325f1cded.zip
Refactor container network to match common Docker network
-rw-r--r--.env23
-rw-r--r--docker-compose.yml45
2 files changed, 39 insertions, 29 deletions
diff --git a/.env b/.env
index 8b74e32..0151c96 100644
--- a/.env
+++ b/.env
@@ -2,15 +2,16 @@
# Environemt variables for docker-compose.yml
#
-# network 'master'
-MASTER_NETWORK_IPV4=192.168.201.0/24
-MASTER_NETWORK_IPV4_GATEWAY=192.168.201.1
-MASTER_NETWORK_IPV6=fd03:4b1d:5707:c9::/64
-MASTER_NETWORK_IPV6_GATEWAY=fd03:4b1d:5707:c9::1
+# network 'bwlp'
+BWLP_NETWORK_NAME=bwlp
+BWLP_NETWORK_IPV4=192.168.200.0/24
+BWLP_NETWORK_IPV4_GATEWAY=192.168.200.1
+BWLP_NETWORK_IPV6=fd03:4b1d:5707:c8::/64
+BWLP_NETWORK_IPV6_GATEWAY=fd03:4b1d:5707:c8::1
# container 'master-server'
-MASTER_SERVER_IPV4=192.168.201.10
-MASTER_SERVER_IPV6=fd03:4b1d:5707:c9::a
+MASTER_SERVER_IPV4=192.168.200.10
+MASTER_SERVER_IPV6=fd03:4b1d:5707:c8::a
MASTER_SERVER_STORAGE=/mnt/bwLehrpool
MASTER_KEYSTORE_FILE=master-server.jks
MASTER_KEYSTORE_ALIAS=master
@@ -22,13 +23,13 @@ MASTER_THRIFT_PORT_PLAIN=9090
MASTER_THRIFT_PORT_SSL=9091
# container 'master-database'
-MASTER_DATABASE_IPV4=192.168.201.20
-MASTER_DATABASE_IPV6=fd03:4b1d:5707:c9::14
+MASTER_DATABASE_IPV4=192.168.200.11
+MASTER_DATABASE_IPV6=fd03:4b1d:5707:c8::b
MASTER_DATABASE_USER=root
MASTER_DATABASE_PASSWORD=master
MASTER_DATABASE_NAME=bwlp
MASTER_DATABASE_DATASET_PATH=setup
# container 'master-phpmyadmin'
-MASTER_PHPMYADMIN_IPV4=192.168.201.30
-MASTER_PHPMYADMIN_IPV6=fd03:4b1d:5707:c9::1e
+MASTER_PHPMYADMIN_IPV4=192.168.200.12
+MASTER_PHPMYADMIN_IPV6=fd03:4b1d:5707:c8::c
diff --git a/docker-compose.yml b/docker-compose.yml
index add1cff..26a9f15 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,7 +3,7 @@ services:
master-server:
container_name: master-server
image: master-server:latest
- hostname: server.master
+ hostname: master-server.${BWLP_NETWORK_NAME}
build:
context: .
dockerfile: pkg/docker/master-server_dockerfile
@@ -38,44 +38,51 @@ services:
MASTER_THRIFT_PORT_PLAIN: ${MASTER_THRIFT_PORT_PLAIN}
MASTER_THRIFT_PORT_SSL: ${MASTER_THRIFT_PORT_SSL}
volumes:
- - master-server:${MASTER_SERVER_STORAGE}
+ - type: volume
+ source: master-server
+ target: ${MASTER_SERVER_STORAGE}
+ read_only: false
depends_on:
- master-database
networks:
- master:
+ bwlp:
ipv4_address: ${MASTER_SERVER_IPV4}
ipv6_address: ${MASTER_SERVER_IPV6}
master-database:
container_name: master-database
image: mariadb:latest
restart: on-failure
- hostname: database.master
+ hostname: master-database.${BWLP_NETWORK_NAME}
environment:
TZ: Europe/Berlin
MYSQL_DATABASE: ${MASTER_DATABASE_NAME}
MYSQL_ROOT_PASSWORD: ${MASTER_DATABASE_PASSWORD}
volumes:
- - master-database:/var/lib/mysql
- - ./${MASTER_DATABASE_DATASET_PATH}:/docker-entrypoint-initdb.d
+ - type: volume
+ source: master-database
+ target: /var/lib/mysql
+ read_only: false
+ - type: bind
+ source: ./${MASTER_DATABASE_DATASET_PATH}
+ target: /docker-entrypoint-initdb.d
+ read_only: true
networks:
- master:
+ bwlp:
ipv4_address: ${MASTER_DATABASE_IPV4}
ipv6_address: ${MASTER_DATABASE_IPV6}
master-phpmyadmin:
container_name: master-phpmyadmin
image: phpmyadmin:latest
- hostname: phpmyadmin.master
+ hostname: master-phpmyadmin.${BWLP_NETWORK_NAME}
restart: on-failure
environment:
PMA_HOST: ${MASTER_DATABASE_IPV4}
- PMA_VERBOSE: database.master
+ PMA_VERBOSE: master-database.${BWLP_NETWORK_NAME}
MYSQL_ROOT_PASSWORD: ${MASTER_DATABASE_PASSWORD}
depends_on:
- master-database
- ports:
- - 8080:80
networks:
- master:
+ bwlp:
ipv4_address: ${MASTER_PHPMYADMIN_IPV4}
ipv6_address: ${MASTER_PHPMYADMIN_IPV6}
volumes:
@@ -84,14 +91,16 @@ volumes:
master-database:
name: master-database
networks:
- master:
- name: master
+ bwlp:
+ name: ${BWLP_NETWORK_NAME}
driver: bridge
+ driver_opts:
+ com.docker.network.bridge.name: br${BWLP_NETWORK_NAME}
enable_ipv6: true
ipam:
driver: default
config:
- - subnet: ${MASTER_NETWORK_IPV4}
- gateway: ${MASTER_NETWORK_IPV4_GATEWAY}
- - subnet: ${MASTER_NETWORK_IPV6}
- gateway: ${MASTER_NETWORK_IPV6_GATEWAY}
+ - subnet: ${BWLP_NETWORK_IPV4}
+ gateway: ${BWLP_NETWORK_IPV4_GATEWAY}
+ - subnet: ${BWLP_NETWORK_IPV6}
+ gateway: ${BWLP_NETWORK_IPV6_GATEWAY}