Added new configs, bootstrap hatch with pip, and updated dockerfile.

This commit is contained in:
th3r00t
2023-11-25 20:29:22 -05:00
parent 1f0b8a6799
commit fa5d567659
3 changed files with 26 additions and 8 deletions

13
docker/Dockerfile vendored
View File

@@ -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

20
docker/config.json vendored
View File

@@ -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"
}

1
docker/requirements.txt vendored Normal file
View File

@@ -0,0 +1 @@
hatch