update mysql checker

This commit is contained in:
ALinuxNinja 2017-04-27 15:33:05 -04:00
parent 1200ea9da1
commit a46322af47
4 changed files with 11 additions and 9 deletions

View File

@ -2,7 +2,7 @@ FROM ruby:2.4
## Install nodejss ## Install nodejss
RUN apt-get -y update \ RUN apt-get -y update \
&& apt-get -y install nodejs \ && apt-get -y install nodejs mysql-client\
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
## Install required gems ## Install required gems

View File

@ -6,5 +6,7 @@ Change configuration in docker-compose.yml to update passwords for MySQL/RabbitM
``` ```
docker-compose up -d docker-compose up -d
``` ```
### Configuration
Configuration is located at data/postal/config after the first start.
Still WIP Still WIP

View File

@ -5,8 +5,7 @@ services:
image: postal image: postal
container_name: postal container_name: postal
volumes: volumes:
- ./data/postal/config:/opt/postal/config - ./data/postal:/opt/postal/config
- ./data/postal/docker:/opt/postal/docker
environment: environment:
- POSTAL_HOSTNAME=idontknow.nowhere.com - POSTAL_HOSTNAME=idontknow.nowhere.com
- MYSQL_ROOT_PASSWORD=changeme - MYSQL_ROOT_PASSWORD=changeme

View File

@ -25,12 +25,13 @@ sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/username.*/username: $RABBITMQ_DEFAULT_U
sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/password.*/password: $RABBITMQ_DEFAULT_PASS/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/password.*/password: $RABBITMQ_DEFAULT_PASS/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml
sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/vhost.*/vhost: \/$RABBITMQ_DEFAULT_VHOST/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/vhost.*/vhost: \/$RABBITMQ_DEFAULT_VHOST/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml
### Initialize DB ## Initialize DB
if [[ ! -f /opt/postal/docker/postal_initialized ]]; then echo "== Waiting for MySQL to start up =="
/opt/postal/bin/postal initialize && touch /opt/postal/docker/postal_initialized while ! mysqladmin ping -h mysql --silent; do
else sleep 1
/opt/postal/bin/postal upgrade done
fi /opt/postal/bin/postal upgrade
## Run ## Run
/opt/postal/bin/postal run /opt/postal/bin/postal run