From 8f8bd934d7967bd1621823c2570166d9d34b8c86 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 11 Feb 2022 15:53:11 +0000 Subject: [PATCH] alternate way to install pyenv --- init-user-db.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init-user-db.sh b/init-user-db.sh index d760b7b0..58f96d52 100644 --- a/init-user-db.sh +++ b/init-user-db.sh @@ -6,7 +6,14 @@ apt-get install -y postgresql-contrib libpq-dev postgis apt-get install -y postgresql-13-postgis-3 apt-get install -y gdal-bin libspatialindex-dev libgeos-dev libproj-dev -apt-get install -y python3 python3-pip python3-dev python3-venv +apt-get install -y python3 python3-pip python3-dev + +# Install pyenv (for some reason installing with apt-get didn't work in docker) +apt-get install -y curl git +echo export PATH="~/.pyenv/bin:$PATH" >> ~/.bashrc +eval "$(pyenv init -)" >> ~/.bashrc +eval "$(pyenv virtualenv-init -)" >> ~/.bashrc +source ~/.bashrc psql -d colouringlondon -U dockeruser -c "SELECT 1 FROM pg_user WHERE usename = 'dockeruser';" | grep -q 1 || psql -d colouringlondon -U dockeruser -c "CREATE ROLE dockeruser SUPERUSER LOGIN PASSWORD 'postgres';" psql -d colouringlondon -U dockeruser -c "SELECT 1 FROM pg_database WHERE datname = 'colouringlondon';" | grep -q 1 || -u postgres createdb -E UTF8 -T template0 --locale=en_US.utf8 -O dockeruser colouringlondon