fix db creation and asset generation

This commit is contained in:
ALinuxNinja 2017-04-27 04:38:29 -04:00
parent 95d3525a4d
commit b94c21a250
3 changed files with 5 additions and 4 deletions

View File

@ -21,8 +21,5 @@ RUN /opt/postal/bin/postal bundle /opt/postal/vendor/bundle
## Stick in startup script
ADD scripts/start.sh /start.sh
## Create docker folder for status keeping
RUN mkdir /opt/postal/docker
## Startup
CMD ["/start.sh"]

View File

@ -4,6 +4,8 @@ services:
build: .
image: postal
container_name: postal
volumes:
- ./data/postal/docker:/opt/postal/docker
links:
- mysql
- rabbitmq

View File

@ -8,7 +8,7 @@ fi
## Set Hostname
sed -i "s/postal\.example\.com/$POSTAL_HOSTNAME/" /opt/postal/config/postal.yml
## Use augeas to set the MySQL/RabbitMQ setup
## Set MySQL/RabbitMQ usernames/passwords
### MySQL Main DB
sed -i -e '/main_db:/!b' -e ':a' -e "s/host.*/host: mysql/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml
sed -i -e'/main_db:/!b' -e ':a' -e "s/username.*/username: root/;t trail" -e 'n;ba' -e ':trail' -e 'n;btrail' /opt/postal/config/postal.yml
@ -27,6 +27,8 @@ sed -i -e '/rabbitmq:/!b' -e ':a' -e "s/vhost.*/vhost: \/$RABBITMQ_DEFAULT_VHOST
### 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
## Clean Up