Files
decomp.me/backend/docker_entrypoint.sh
Ethan Roseman 36d1f1d706 Poetry (#366)
* Trying to set up poetry

* oops

* mypy python 3.9

* mark

* blah

* attempt to fix stuff

* .

* fixies

* try winders again

* doqqer

* tomorrow for sure!

* attempt to install poetry as user

* help

* docker fix?

* ?

* try thing

* oh god

* the path to victory

* meowp

* srob

* try to do it manually on windows, install on docker

* try to do it manually on windows, install on docker: the sequel

* winders

* drf extensions

* winders 2

* use pip to install poetry on winders

* execute 'poetry install' at runtime, same as yarn install (#377)

Co-authored-by: Mark Street <22226349+mkst@users.noreply.github.com>
2022-02-20 22:46:00 +09:00

23 lines
515 B
Bash
Executable File

#!/bin/bash
DB_HOST=${DATABASE_HOST:-postgres}
DB_PORT=${DATABASE_PORT:-5432}
BE_HOST=${BACKEND_HOST:-0.0.0.0}
BE_PORT=${BACKEND_PORT:-8000}
until nc -z ${DB_HOST} ${DB_PORT} > /dev/null; do
echo "Waiting for database to become available on ${DB_HOST}:${DB_PORT}..."
sleep 1
done
poetry config virtualenvs.path /backend/virtualenvs
poetry install
poetry run /backend/manage.py migrate
poetry run /backend/manage.py loaddata /backend/db.json
poetry run /backend/manage.py runserver ${BE_HOST}:${BE_PORT}