diff --git a/Dockerfile b/Dockerfile index 21978a7..2649482 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,6 @@ RUN apt-get update && \ postgresql-plpython3-9.6 postgresql-plpython-9.6 \ && rm -rf /var/lib/apt/lists/* -COPY * / - COPY init.sh /docker-entrypoint-initdb.d/init.sh ENV POSTGRES_USER postgres diff --git a/README.md b/README.md index c4c5b22..1651b7c 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,10 @@ ## Usage -In this folder: -`docker build -t oep_postgres .` -`docker run -p "5432:5432" oep_postgres` - -In your project folder: -`OEP_DB_USER=postgres OEP_DB_PASSWORD=postgres LOCAL_DB_USER=postgres LOCAL_DB_PASSWORD=postgres python manage.py runserver` -`OEP_DB_USER=postgres OEP_DB_PASSWORD=postgres LOCAL_DB_USER=postgres LOCAL_DB_PASSWORD=postgres python manage.py alembic ` +``` +docker run -v "$(pwd)/oeplatform_data:/var/lib/postgresql/data" -p "5432:5432" ghcr.io/openenergyplatform/oeplatform-postgres:latest +``` +It starts a already built docker container, exposes port 5432 to your local machine and creates a data directory in a `oeplatform_data` folder at your current path. ## What does this? @@ -21,8 +18,8 @@ Before you can get started, we need to migrate the oedb migrations. All relevant settings are stored in `/oeplatform/securitysettings.py`, which is normally created by using the `securitysettings.py.default`. We included the usage of environment variables to archieve configuration options. You need to set the following configuration options: -+ `OEP_DB_USER=postgres` -+ `OEP_DB_PASSWORD=postgres` ++ `OEP_DJANGO_USER=postgres` ++ `OEP_DB_PW=postgres` + `LOCAL_DB_USER=postgres` + `LOCAL_DB_PASSWORD=postgres` diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index db9a6e1..0000000 --- a/docs/installation.md +++ /dev/null @@ -1,51 +0,0 @@ -## Requirements - * git - * Python >= 3.5 - -## Docker Setup - -### For Windows - -1. [Install docker desktop](https://docs.docker.com/docker-for-windows/install/) -2. Open the Windows PowerShell -3. Run `docker pull oeplatform/oeplatform-deploy` to pull the latest docker image -4. Run `docker run -p ":5432" oeplatform/oeplatform-deploy` - run a postgres database with all necessary databases on port `` - -### For Ubuntu - -1. [Install docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/) -2. Run `docker pull oeplatform/oeplatform-deploy` to pull the latest docker image -3. Run `docker run -p ":5432" oeplatform/oeplatform-deploy` - run a postgres database with all necessary databases on port `` - - -## Connect your oep to docker - -1. Clone the [OEP source code](https://github.com/OpenEnergyPlatform/oeplatform) - - We recommend the use of a [virtual python environment](https://docs.python.org/3/tutorial/venv.html) to avoid conflicts -2. Run `pip install -r requirements.txt` to install all requirements -2. Copy the file `oeplatform/securitysettings.py.default` to `oeplatform/securitysettings.py` and alter it to match the following settings: -``` -dbuser = "postgres" -dbpasswd = "postgres" -dbport = -dbhost = "localhost" -dbname = "dataedit" -``` - -``` -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'django', - 'USER': 'postgres', - 'PASSWORD': 'postgres', - 'HOST': 'localhost', - 'PORT': - } -} -``` -3. Run `python manage.py migrate` to setup the required tables used by django -4. Run `python manage.py runserver` to start the platform on port 8000 -5. Your instance of the OEP is now available at localhost:8000 \ No newline at end of file