Adding docker directory with docker support

This commit is contained in:
Tony Hendrick
2020-05-12 21:38:25 -07:00
parent 245f3d09a8
commit 9014081bff
5 changed files with 47 additions and 1 deletions

2
config.json vendored
View File

@@ -1 +1 @@
{"TITLE": "pyShelf E-Book Server", "VERSION": "0.5.0", "BOOKPATH": "", "DB_HOST": "db", "DB_PORT": "5432", "DATABASE": "pyshelf", "USER": "pyshelf", "PASSWORD": "mysecretpassword", "BOOKSHELF": "data/shelf.json", "ALLOWED_HOSTS": "*", "hostname": "localhost", "webport": "8000", "wsgiport": "8001"}
{"TITLE": "pyShelf E-Book Server", "VERSION": "0.5.0", "BOOKPATH": "", "DB_HOST": "db", "DB_PORT": "5432", "DATABASE": "pyshelf", "USER": "pyshelf", "PASSWORD": "pyshelf", "BOOKSHELF": "data/shelf.json", "ALLOWED_HOSTS": "*", "hostname": "localhost", "webport": "8000", "wsgiport": "8001"}

6
docker/.env vendored Normal file
View File

@@ -0,0 +1,6 @@
LOCAL_BOOK_DIR=/home/marvin/git/hatpyShelf/docker/Books/
PORT=8088
POSTGRES_VER=12.2
POSTGRES_USER=pyshelf
POSTGRES_PASSWORD=pyshelf
POSTGRES_DB=pyshelf

18
docker/Dockerfile vendored Normal file
View File

@@ -0,0 +1,18 @@
# docker build -t ubuntu1604py36
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update -y
RUN apt-get install -y build-essential python3.8 python3.8-dev python3-pip python3.8-venv && apt-get install -y git
# update pip
RUN python3 -m pip install wheel
RUN git clone https://github.com/hat/pyShelf.git /usr/src/app/
RUN python3 -m pip install -r /usr/src/app/requirements.txt
#CMD [""]
#RUN python3 manage.py migrate
#RUN python3 manage.py migrate interface
WORKDIR /usr/src/app/src/
CMD ["python3", "manage.py", "runserver"]

21
docker/docker-compose.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
version: "3.3"
services:
db:
image: "postgres:${POSTGRES_VER}"
environment:
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
- "POSTGRES_USER=${POSTGRES_USER}"
- "POSTGRES_DB=${POSTGRES_DB}"
pyshelf:
build:
context: ./
dockerfile: Dockerfile
volumes:
- "${LOCAL_BOOK_DIR}:/Books"
ports:
- "8088:8000"
links:
- "db:db"
depends_on:
- db

1
requirements.txt vendored
View File

@@ -17,3 +17,4 @@ psycopg2-binary
prompt_toolkit
psutil
pyfiglet
pudb