First working draft docker-compose

This commit is contained in:
MartenBE
2020-07-30 16:57:39 +02:00
parent be2c525d9a
commit d555d94be9
16 changed files with 77 additions and 541 deletions

6
docker/.env vendored
View File

@@ -1,6 +0,0 @@
LOCAL_BOOK_DIR=/home/user/pyShelf/Books
PORT=8088
POSTGRES_VER=12.2
POSTGRES_USER=pyshelf
POSTGRES_PASSWORD=pyshelf
POSTGRES_DB=pyshelf

20
docker/Dockerfile vendored
View File

@@ -1,20 +0,0 @@
# 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
EXPOSE 8000
WORKDIR /usr/src/app/src/
#RUN ../docker/scripts/wait-for-it.sh db:5432
RUN python3 manage.py migrate
#RUN python3 manage.py migrate interface
CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]

View File

@@ -1,30 +0,0 @@
version: "3.7"
services:
db:
image: "postgres:${POSTGRES_VER}"
environment:
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
- "POSTGRES_USER=${POSTGRES_USER}"
- "POSTGRES_DB=${POSTGRES_DB}"
volumes:
- ./postgres_data/:/var/lib/postgresql/data/
pyshelf:
build:
context: ./
dockerfile: Dockerfile
volumes:
- "${LOCAL_BOOK_DIR}:/usr/src/app/Books"
# - "./cron/root:/etc/crontabs/root"
# - "./scripts/wait-for-it.sh:/usr/src/app/src/"
ports:
- "${PORT}:8000"
depends_on:
- db
networks:
default:
driver: bridge
ipam:
config:
- subnet: 10.20.20.0/24