diff --git a/.gitignore b/.gitignore index ee9f18d..3c26422 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,8 @@ __pycache__ spine/projects/* spine/Spine-Database-API spine/Spine-Toolbox -venv +.env +.venv .vscode local.json client_secrets.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1b9a56b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.12 + +WORKDIR /app + +COPY . /app + +RUN apt update && apt install -y \ + build-essential \ + gcc \ + libpq-dev \ + python3-dev + +RUN pip install --upgrade pip setuptools wheel +RUN pip install GDX2py +RUN pip install spinedb_api --verbose + +ENTRYPOINT [ "python", "src/app.py" ] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..70d8f43 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +.PHONY: run +include .env +export + +# target: help - Display callable targets. +help: + @egrep "^# target:" [Mm]akefile + +# target: run - Run local web server. +run: + python src/app.py \ No newline at end of file diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..2191946 --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,8 @@ +services: + rescalc: + image: rescalc + build: + context: . + dockerfile: ./install/Dockerfile + ports: + - 5000:5000 diff --git a/docker-compose.yml b/docker-compose.yml index a04f910..21f6083 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,16 @@ - services: rescalc: - image: rescalc build: context: . - dockerfile: ./install/Dockerfile ports: - - 5000:5000 \ No newline at end of file + - 5000:5000 + db: + image: postgres:16 + env_file: .env + ports: + - 5432:5432 + volumes: + - pgdata:/var/lib/postgresql/data + +volumes: + pgdata: diff --git a/requirements.txt b/requirements.txt index 1731cc6..e4c7d17 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,13 @@ -wheel -Flask==1.1.4 -sqlalchemy -flask_oidc -okta -jill -pytest -PySide2 --e git+https://github.com/spine-tools/spine-engine.git@7be63302466f2826ab80ffa0730e31a052770fc4#egg=spine_engine --e git+https://github.com/spine-tools/spine-items.git@f08c405fdcc4effc36da93d96239caf211718e92#egg=spine_items --e git+https://github.com/spine-tools/Spine-Database-API.git@c147f787f314413356ce3a59cf608d6bbcd4bfa4#egg=spinedb_api --e git+https://github.com/Spine-project/Spine-Toolbox.git@ee6c75e046f38f09e43314da9dfcf5bca8303d4a#egg=spinetoolbox \ No newline at end of file +# flask==2.3.3 +# flask_oidc +# jill +# okta +# pytest +# pyside6 +# spine_engine +# sqlalchemy +spinedb_api +# -e git+https://github.com/spine-tools/spine-engine.git@7be63302466f2826ab80ffa0730e31a052770fc4#egg=spine_engine +# -e git+https://github.com/spine-tools/spine-items.git@f08c405fdcc4effc36da93d96239caf211718e92#egg=spine_items +# -e git+https://github.com/spine-tools/Spine-Database-API.git@c147f787f314413356ce3a59cf608d6bbcd4bfa4#egg=spinedb_api +# -e git+https://github.com/Spine-project/Spine-Toolbox.git@ee6c75e046f38f09e43314da9dfcf5bca8303d4a#egg=spinetoolbox \ No newline at end of file