| #!/bin/bash |
|
|
| |
| echo "Starting PostgreSQL..." |
| service postgresql start |
|
|
| |
| until pg_isready -h localhost; do |
| echo "Waiting for Postgres..." |
| sleep 1 |
| done |
|
|
| |
| |
| PG_CONF=$(find /etc/postgresql -name "pg_hba.conf") |
|
|
| |
| echo "host all all 127.0.0.1/32 trust" > $PG_CONF |
| |
| echo "host all all ::1/128 trust" >> $PG_CONF |
| |
| echo "local all all trust" >> $PG_CONF |
|
|
| |
| service postgresql restart |
|
|
| |
| su - postgres -c "psql -c \"CREATE USER playground SUPERUSER;\"" |
| su - postgres -c "psql -c \"CREATE DATABASE playground OWNER playground;\"" |
|
|
|
|
| |
| echo "Starting MySQL..." |
| service mariadb start |
|
|
| |
| mysql -e "CREATE DATABASE IF NOT EXISTS playground;" |
| mysql -e "CREATE USER IF NOT EXISTS 'playground'@'localhost';" |
| mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'playground'@'localhost';" |
| mysql -e "FLUSH PRIVILEGES;" |
|
|
|
|
| |
| echo "Starting Gunicorn..." |
| |
| |
| |
| exec gunicorn -w 4 --threads 4 -b 0.0.0.0:7860 app:app |