fix db creation and asset generation
This commit is contained in:
parent
95d3525a4d
commit
b94c21a250
|
@ -21,8 +21,5 @@ RUN /opt/postal/bin/postal bundle /opt/postal/vendor/bundle
|
||||||
## Stick in startup script
|
## Stick in startup script
|
||||||
ADD scripts/start.sh /start.sh
|
ADD scripts/start.sh /start.sh
|
||||||
|
|
||||||
## Create docker folder for status keeping
|
|
||||||
RUN mkdir /opt/postal/docker
|
|
||||||
|
|
||||||
## Startup
|
## Startup
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
|
|
|
@ -4,6 +4,8 @@ services:
|
||||||
build: .
|
build: .
|
||||||
image: postal
|
image: postal
|
||||||
container_name: postal
|
container_name: postal
|
||||||
|
volumes:
|
||||||
|
- ./data/postal/docker:/opt/postal/docker
|
||||||
links:
|
links:
|
||||||
- mysql
|
- mysql
|
||||||
- rabbitmq
|
- rabbitmq
|
||||||
|
|
|
@ -8,7 +8,7 @@ fi
|
||||||
## Set Hostname
|
## Set Hostname
|
||||||
sed -i "s/postal\.example\.com/$POSTAL_HOSTNAME/" /opt/postal/config/postal.yml
|
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
|
### 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/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
|
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
|
### Initialize DB
|
||||||
if [[ ! -f /opt/postal/docker/postal_initialized ]]; then
|
if [[ ! -f /opt/postal/docker/postal_initialized ]]; then
|
||||||
/opt/postal/bin/postal initialize && touch /opt/postal/docker/postal_initialized
|
/opt/postal/bin/postal initialize && touch /opt/postal/docker/postal_initialized
|
||||||
|
else
|
||||||
|
/opt/postal/bin/postal upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Clean Up
|
## Clean Up
|
||||||
|
|
Loading…
Reference in New Issue
Block a user