From 7a96b7dc899c93a7886e8d47a59cfac99b9a61bf Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Sat, 6 Jan 2018 13:42:59 -0500 Subject: [PATCH] More docker stuff --- Dockerfile | 13 +++++++++++-- docker-compose.yml | 13 +++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4d08229..c888643 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,20 @@ FROM python:3 -EXPOSE 8000 -ADD . / +# Add files +RUN mkdir /site +WORKDIR /site +ADD . /site/ + +# Set up configs RUN rm OACPL/settings.py RUN mv OACPL/settings.base.py OACPL/settings.py +# Install packages RUN pip install -r requirements.txt + +# Initialize Django RUN python3 manage.py makemigrations --no-input RUN python3 manage.py migrate --no-input RUN python3 manage.py collectstatic --no-input + +EXPOSE 8000 diff --git a/docker-compose.yml b/docker-compose.yml index 70c8bc3..6d43f01 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,16 @@ -version: 1 +version: '3' services: db: - image: sqlite3 + image: postgres web: - command: python3 manage.py runserver - image: django build: . + command: python3 manage.py runserver 0.0.0.0:8000 + volumes: + - .:/code + ports: + - "8000:8000" + depends_on: + - db