From fa5d5676592ec1ec7442d2b26e6446631c1749bd Mon Sep 17 00:00:00 2001 From: th3r00t Date: Sat, 25 Nov 2023 20:29:22 -0500 Subject: [PATCH] Added new configs, bootstrap hatch with pip, and updated dockerfile. --- docker/Dockerfile | 13 ++++++------- docker/config.json | 20 +++++++++++++++++++- docker/requirements.txt | 1 + 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 docker/requirements.txt diff --git a/docker/Dockerfile b/docker/Dockerfile index 7fc4b9c..d178cd7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,18 +9,17 @@ # docker login # docker push pyshelf/pyshelf -FROM ubuntu +FROM python:3 EXPOSE 8000 EXPOSE 1337 -RUN apt-get update -y -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python3.12 python3.12-dev python3.12-pip python3.12-venv python3.12-hatch +# RUN apt-get update -y +# RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python312 python312-dev python312-pip python312-venv python312-hatch COPY . /pyshelf COPY ./docker/config.json /pyshelf/config.json - +COPY ./docker/requirements.txt /pyshelf/requirements.txt WORKDIR /pyshelf/ -RUN python3.12 -m hatch shell - -ENTRYPOINT python3.12 pyshelf.py +RUN python -m pip install --no-cache-dir -r requirements.txt +ENTRYPOINT hatch run ./pyShelf.py diff --git a/docker/config.json b/docker/config.json index 1f578d7..d4be7f5 100644 --- a/docker/config.json +++ b/docker/config.json @@ -1 +1,19 @@ -{"TITLE": "pyShelf E-Book Server", "VERSION": "0.8.0", "BOOKPATH": "/books", "DB_HOST": "localhost", "DB_PORT": "5432", "DATABASE": "pyshelf", "USER": "pyshelf", "PASSWORD": "pyshelf", "BOOKSHELF": "data/shelf.json", "ALLOWED_HOSTS": ["localhost", "127.0.0.1", "[::1]", "0.0.0.0"], "BUILD_MODE": "production"} +{ + "TITLE": "pyShelf E-Book Server", + "VERSION": "0.8.0", + "BOOKPATH": "/books", + "DB_HOST": "localhost", + "DB_PORT": "5432", + "DB_ENGINE": "psql", + "DATABASE": "pyshelf", + "USER": "pyshelf", + "PASSWORD": "pyshelf", + "BOOKSHELF": "data/shelf.json", + "ALLOWED_HOSTS": [ + "localhost", + "127.0.0.1", + "[::1]", + "0.0.0.0" + ], + "BUILD_MODE": "production" +} diff --git a/docker/requirements.txt b/docker/requirements.txt new file mode 100644 index 0000000..f06bada --- /dev/null +++ b/docker/requirements.txt @@ -0,0 +1 @@ +hatch