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
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

View File

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

View File

@ -5,8 +5,7 @@ services:
image: postal
container_name: postal
volumes:
- ./data/postal/config:/opt/postal/config
- ./data/postal/docker:/opt/postal/docker
- ./data/postal:/opt/postal/config
environment:
- POSTAL_HOSTNAME=idontknow.nowhere.com
- 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/vhost.*/vhost: \/$RABBITMQ_DEFAULT_VHOST/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml
### Initialize DB
if [[ ! -f /opt/postal/docker/postal_initialized ]]; then
/opt/postal/bin/postal initialize && touch /opt/postal/docker/postal_initialized
else
/opt/postal/bin/postal upgrade
fi
## Initialize DB
echo "== Waiting for MySQL to start up =="
while ! mysqladmin ping -h mysql --silent; do
sleep 1
done
/opt/postal/bin/postal upgrade
## Run
/opt/postal/bin/postal run