From ef876204c45e80039da5cdfeea692d1717bed4a4 Mon Sep 17 00:00:00 2001 From: ILoveYaToo Date: Mon, 13 Apr 2020 22:38:14 -0400 Subject: [PATCH] remove mounts from docker-compose, add checks for database creation --- alpine/docker-compose.yml | 9 +++++---- ubuntu/docker-compose.yml | 9 +++++---- ubuntu/src/docker-entrypoint.sh | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/alpine/docker-compose.yml b/alpine/docker-compose.yml index 3efcda2..2dfcd48 100644 --- a/alpine/docker-compose.yml +++ b/alpine/docker-compose.yml @@ -11,7 +11,7 @@ services: - "rabbitmq" volumes: - static_assets:/opt/postal/public - - ./data/postal/assets:/opt/postal/public/assets + - postal_assets:/opt/postal/public/assets - ./src/templates/:/templates environment: - MYSQL_ROOT_PASSWORD=changeme @@ -23,7 +23,7 @@ services: image: mariadb:10 container_name: postal_mysql volumes: - - ./data/mysql:/var/lib/mysql + - mysql_data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=changeme - MYSQL_DATABASE=postal @@ -46,7 +46,8 @@ services: volumes: - ./src/nginx.conf:/etc/nginx/conf.d/default.conf:ro - static_assets:/opt/postal/public:ro - - ./data/postal/assets:/opt/postal/public/assets:ro + - postal_assets:/opt/postal/public/assets:ro volumes: static_assets: - + postal_assets: + mysql_data: diff --git a/ubuntu/docker-compose.yml b/ubuntu/docker-compose.yml index cb399e4..3ad25db 100644 --- a/ubuntu/docker-compose.yml +++ b/ubuntu/docker-compose.yml @@ -11,7 +11,7 @@ services: - "rabbitmq" volumes: - static_assets:/opt/postal/public - - ./data/postal/assets:/opt/postal/public/assets + - postal_assets:/opt/postal/public/assets - ./src/templates/:/templates environment: - MYSQL_ROOT_PASSWORD=changeme @@ -23,7 +23,7 @@ services: image: mariadb:10 container_name: postal_mysql volumes: - - ./data/mysql:/var/lib/mysql + - mysql_data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=changeme - MYSQL_DATABASE=postal @@ -46,7 +46,8 @@ services: volumes: - ./src/nginx.conf:/etc/nginx/conf.d/default.conf:ro - static_assets:/opt/postal/public:ro - - ./data/postal/assets:/opt/postal/public/assets:ro + - postal_assets:/opt/postal/public/assets:ro volumes: static_assets: - + postal_assets: + mysql_data: diff --git a/ubuntu/src/docker-entrypoint.sh b/ubuntu/src/docker-entrypoint.sh index 9180eff..18eae1d 100755 --- a/ubuntu/src/docker-entrypoint.sh +++ b/ubuntu/src/docker-entrypoint.sh @@ -20,7 +20,7 @@ echo "== Waiting for MySQL to start up ==" while ! mysqladmin ping -h mysql --silent; do sleep 0.5 done -while ! mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e 'use postal' 2> /dev/null; do +while ! mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "$MYSQL_DATABASE" 2> /dev/null; do sleep 0.5 done