Skip to content

Commit

Permalink
Get things kind of working with Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgleason committed Jul 26, 2023
1 parent 35258ca commit ce6c423
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 3 deletions.
Empty file removed --reload-core
Empty file.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ settings_secret.py
static/img
*.swp
lib
__pycache__
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.8

WORKDIR /app
ENV DJANGO_SETTINGS_MODULE=QI.settings_docker

COPY requirements.txt /app/requirements.txt

RUN pip install -r /app/requirements.txt

COPY . /app

EXPOSE 8000
ENV PORT=8000

CMD gunicorn --reload --bind 0.0.0.0:${PORT:-8000} QI.wsgi:application
5 changes: 4 additions & 1 deletion QI/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

from .settings_secret import *
try:
from .settings_secret import *
except:
pass

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

Expand Down
9 changes: 9 additions & 0 deletions QI/settings_docker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os

from .settings import *

DEBUG = os.environ.get('DEBUG', '').lower() in ['true', '1']

ALLOWED_HOSTS = ['*']

SECRET_KEY = os.environ.get('SECRET_KEY')
11 changes: 11 additions & 0 deletions compose-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.9"

services:
web:
build: .
volumes:
- .:/app
ports:
- "8000:8000"
environment:
- SECRET_KEY=1
6 changes: 4 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ Django==2.0.6
django-haystack==2.8.1
django-import-export==1.0.1
et-xmlfile==1.0.1
gunicorn==20.1.0
html5lib==0.9999999
idna==2.7
jdcal==1.4
lxml==4.2.3
lxml==4.9.3
odfpy==1.3.6
openpyxl==2.5.4
Pillow==5.1.0
psycopg2==2.7.5
psycopg2==2.9.6
psycopg2-binary==2.9.6
pysolr==3.7.0
pytz==2018.4
PyYAML==4.2b1
Expand Down

0 comments on commit ce6c423

Please sign in to comment.