diff --git a/Dockerfile b/Dockerfile index 68d2b30..f9f985a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM ruby:2.4 -## Install nodejs +## Install nodejs and mysql-client RUN apt-get -y update \ -&& apt-get -y install nodejs \ +&& apt-get -y install nodejs mysql-client\ && rm -rf /var/lib/apt/lists/* ## Install required gems diff --git a/docker-compose.yml b/docker-compose.yml index 69e8d1b..7fe25cd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,8 @@ services: - "mysql" - "rabbitmq" volumes: - - ./data/postal:/opt/postal/config + - ./data/postal/assets:/opt/postal/public/assets + - ./data/postal/config:/opt/postal/config - ./data/docker:/docker environment: - MYSQL_ROOT_PASSWORD=changeme diff --git a/wrapper.sh b/wrapper.sh index c5cd71a..2b62dab 100755 --- a/wrapper.sh +++ b/wrapper.sh @@ -32,5 +32,11 @@ sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/vhost.*/vhost: \/$RABBITMQ_DEFAULT_VHOST ## Clean Up rm -rf /opt/postal/tmp/pids/* +## Wait for MySQL to start up +echo "== Waiting for MySQL to start up ==" +while ! mysqladmin ping -h mysql --silent; do + sleep 0.5 +done + ## Start Postal /opt/postal/bin/postal "$@"