mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Refactoring Collections, and getting docker ready.
This commit is contained in:
23
docker/Dockerfile
vendored
23
docker/Dockerfile
vendored
@@ -9,17 +9,30 @@
|
||||
# docker login
|
||||
# docker push pyshelf/pyshelf
|
||||
|
||||
FROM python:3
|
||||
FROM ubuntu:latest
|
||||
|
||||
EXPOSE 8000
|
||||
EXPOSE 8080
|
||||
EXPOSE 1337
|
||||
|
||||
# RUN apt-get update -y
|
||||
# RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential python312 python312-dev python312-pip python312-venv python312-hatch
|
||||
RUN apt-get update -y
|
||||
RUN apt-get upgrade -y
|
||||
RUN apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev \
|
||||
libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget \
|
||||
libbz2-dev curl -y
|
||||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
|
||||
RUN export NVM_DIR="$HOME/.nvm" ; \
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" ; nvm install 14 npm
|
||||
WORKDIR /tmp
|
||||
RUN wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz
|
||||
RUN tar -xf Python-3.12.0.tgz
|
||||
WORKDIR /tmp/Python-3.12.0/
|
||||
RUN ./configure --enable-optimizations
|
||||
RUN make -j 4
|
||||
RUN make install
|
||||
|
||||
COPY . /pyshelf
|
||||
COPY ./docker/config.json /pyshelf/config.json
|
||||
COPY ./docker/requirements.txt /pyshelf/requirements.txt
|
||||
WORKDIR /pyshelf/
|
||||
RUN python -m pip install --no-cache-dir -r requirements.txt
|
||||
RUN python3 -m pip install --no-cache-dir -r requirements.txt
|
||||
ENTRYPOINT hatch run ./pyShelf.py
|
||||
|
||||
2
docker/README.md
vendored
2
docker/README.md
vendored
@@ -2,5 +2,3 @@ Use `docker build -t pyshelf/pyshelf -f ./docker/Dockerfile .` in the project ro
|
||||
|
||||
Make sure the following files are in sync:
|
||||
* config.json
|
||||
* docker/pyshelf_nginx.conf
|
||||
* uwsgi.ini
|
||||
6
docker/config.json
vendored
6
docker/config.json
vendored
@@ -2,9 +2,9 @@
|
||||
"TITLE": "pyShelf E-Book Server",
|
||||
"VERSION": "0.8.0",
|
||||
"BOOKPATH": "/books",
|
||||
"DB_HOST": "localhost",
|
||||
"DB_PORT": "5432",
|
||||
"DB_ENGINE": "psql",
|
||||
"DB_HOST": "127.0.0.1",
|
||||
"DB_PORT": "5433",
|
||||
"DB_ENGINE": "sqlite",
|
||||
"DATABASE": "pyshelf",
|
||||
"USER": "pyshelf",
|
||||
"PASSWORD": "pyshelf",
|
||||
|
||||
34
docker/development.docker-compose.yml
vendored
34
docker/development.docker-compose.yml
vendored
@@ -1,34 +1,36 @@
|
||||
version: "3.7"
|
||||
|
||||
# This file is used to test the Dockerhub image. To host pyShelf yourself for
|
||||
# production, please use the official pyShelf image on
|
||||
# This file is used to test the Dockerhub image. To host pyShelf yourself for
|
||||
# production, please use the official pyShelf image on
|
||||
# https://hub.docker.com/r/pyshelf/pyshelf
|
||||
|
||||
# For development, use the following command in the root folder:
|
||||
#
|
||||
#
|
||||
# docker-compose -f ./docker/development.docker-compose.yml up --build
|
||||
|
||||
services:
|
||||
db:
|
||||
image: "postgres"
|
||||
environment:
|
||||
- "POSTGRES_PASSWORD=pyshelf"
|
||||
- "POSTGRES_USER=pyshelf"
|
||||
- "POSTGRES_DB=pyshelf"
|
||||
volumes:
|
||||
- "db_data:/var/lib/postgresql/data/"
|
||||
# db:
|
||||
# image: "postgres"
|
||||
# environment:
|
||||
# - "POSTGRES_PASSWORD=pyshelf"
|
||||
# - "POSTGRES_USER=pyshelf"
|
||||
# - "POSTGRES_DB=pyshelf"
|
||||
# volumes:
|
||||
# - "db_data:/var/lib/postgresql/data/"
|
||||
# ports:
|
||||
# - "5433:5432"
|
||||
|
||||
pyshelf:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ./docker/Dockerfile
|
||||
ports:
|
||||
ports:
|
||||
- "8080:8000"
|
||||
- "1337:1337"
|
||||
volumes:
|
||||
- "${LOCAL_BOOK_DIR}:/books"
|
||||
depends_on:
|
||||
- db
|
||||
# depends_on:
|
||||
# - db
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
# volumes:
|
||||
# db_data:
|
||||
|
||||
28
docker/docker-compose.yml
vendored
28
docker/docker-compose.yml
vendored
@@ -1,15 +1,17 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: "postgres"
|
||||
restart: always
|
||||
environment:
|
||||
- "POSTGRES_PASSWORD=pyshelf"
|
||||
- "POSTGRES_USER=pyshelf"
|
||||
- "POSTGRES_DB=pyshelf"
|
||||
volumes:
|
||||
- "db_data:/var/lib/postgresql/data/"
|
||||
# db:
|
||||
# image: "postgres"
|
||||
# restart: always
|
||||
# environment:
|
||||
# - "POSTGRES_PASSWORD=pyshelf"
|
||||
# - "POSTGRES_USER=pyshelf"
|
||||
# - "POSTGRES_DB=pyshelf"
|
||||
# volumes:
|
||||
# - "db_data:/var/lib/postgresql/data/"
|
||||
# ports:
|
||||
# - "5433:5432"
|
||||
pyshelf:
|
||||
image: "pyshelf/pyshelf"
|
||||
restart: always
|
||||
@@ -18,7 +20,7 @@ services:
|
||||
- "1337:1337"
|
||||
volumes:
|
||||
- "${LOCAL_BOOK_DIR}:/books"
|
||||
depends_on:
|
||||
- db
|
||||
volumes:
|
||||
db_data:
|
||||
# depends_on:
|
||||
# - db
|
||||
#volumes:
|
||||
# db_data:
|
||||
|
||||
Reference in New Issue
Block a user