diff --git a/docker-compose.yml b/docker-compose.yml index 2592ee17..7b2e395f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,8 +16,6 @@ services: db: image: postgres - volumes: - - ./scripts/pgsql/create-databases.sh:/docker-entrypoint-initdb.d/create-databases.sh:z healthcheck: test: runuser postgres -c "pg_isready" interval: 10s @@ -27,6 +25,9 @@ services: POSTGRES_USER: root POSTGRES_PASSWORD: root POSTGRES_DB: root + PGDATA : /var/lib/postgresql/data/ + volumes: + - colab_data:/var/lib/postgresql/data/ colab: image: labhackercd/edemocracia-colab @@ -66,7 +67,6 @@ services: AUDIENCIAS_API_KEY: secret_key WIKILEGIS_API_KEY: api_key volumes: - - .:/var/labhacker/colab/colab - colab_assets:/var/labhacker/colab/public:z links: - 'audienciasweb' diff --git a/scripts/pgsql/create-databases.sh b/scripts/pgsql/create-databases.sh deleted file mode 100755 index 7d6b83dd..00000000 --- a/scripts/pgsql/create-databases.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - CREATE DATABASE colab OWNER root; - CREATE DATABASE audiencias OWNER root; - CREATE DATABASE wikilegis OWNER root; -EOSQL diff --git a/start-colab.sh b/start-colab.sh index e37d1d00..0c6cbd7d 100755 --- a/start-colab.sh +++ b/start-colab.sh @@ -30,8 +30,12 @@ if [[ "$ENABLE_AUDIENCIAS" = true ]]; then fi crond + +PGPASSWORD=$DATABASE_PASSWORD psql -U $DATABASE_USER -w -h $DATABASE_HOST -c "CREATE DATABASE ${DATABASE_NAME} OWNER root" colab-admin migrate colab-admin initdb + colab-admin compress --force colab-admin collectstatic --noinput + gunicorn colab.wsgi:application --config=/etc/colab/gunicorn.py \ No newline at end of file