diff --git a/dockerfiles/swh-storage/Dockerfile b/dockerfiles/swh-storage/Dockerfile index 8397a97..198e8f7 100644 --- a/dockerfiles/swh-storage/Dockerfile +++ b/dockerfiles/swh-storage/Dockerfile @@ -1,15 +1,15 @@ FROM python:3.6 RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y \ libsystemd-dev postgresql-client RUN pip install --upgrade pip setuptools wheel -RUN pip install swh-storage +RUN pip install swh-storage gunicorn COPY entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] EXPOSE 5002 diff --git a/dockerfiles/swh-storage/entrypoint.sh b/dockerfiles/swh-storage/entrypoint.sh index b5230db..0a7a304 100755 --- a/dockerfiles/swh-storage/entrypoint.sh +++ b/dockerfiles/swh-storage/entrypoint.sh @@ -1,42 +1,45 @@ #!/bin/bash set -e if [[ -d /src ]] ; then for srcrepo in /src/swh-* ; do pushd $srcrepo pip install -e . popd done fi echo Installed Python packages: pip list echo "${PGHOST}:5432:${POSTGRES_DB}:${PGUSER}:${POSTGRES_PASSWORD}" > ~/.pgpass cat > ~/.pg_service.conf < /dev/null 2> /dev/null; do sleep 0.1; done echo Setup the database PGPASSWORD=${POSTGRES_PASSWORD} swh-db-init storage \ --db-name ${POSTGRES_DB} echo Starting the swh-storage API server - exec python -m swh.storage.api.server /storage.yml + exec gunicorn --bind 0.0.0.0:5002 \ + --reload \ + --log-level DEBUG \ + swh.storage.api.wsgi ;; esac diff --git a/env/storage.env b/env/storage.env index 8c16b00..f802fd4 100644 --- a/env/storage.env +++ b/env/storage.env @@ -1,4 +1,5 @@ POSTGRES_PASSWORD=testpassword POSTGRES_DB=swh-storage PGHOST=swh-storage-db PGUSER=postgres +SWH_CONFIG_FILENAME=/storage.yml \ No newline at end of file