diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..63f97cd0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.6 +ENV PYTHONUNBUFFERED 1 +RUN mkdir /lilcity +WORKDIR /lilcity +ADD requirements.txt /lilcity/ +RUN apt-get update \ + && apt-get install -y postgresql-client-9.4 \ + && rm -rf /var/lib/apt/lists/* \ + && pip install --upgrade pip \ + && pip install -r requirements.txt +ADD . /lilcity/ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..69420d7b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3' +services: + postgres: + image: postgres:9.6 + environment: + - POSTGRES_PASSWORD=1234 + - POSTGRES_USER=postgres + + web: + build: . + restart: always + volumes: + - .:/lilcity + command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000" + environment: + - DJANGO_SETTINGS_MODULE=project.settings + ports: + - "8000:8000" + depends_on: + - postgres \ No newline at end of file diff --git a/project/settings.py b/project/settings.py index 5743181b..50b67717 100644 --- a/project/settings.py +++ b/project/settings.py @@ -25,7 +25,7 @@ SECRET_KEY = 'jelm*91lj(_-o20+6^a+bgv!4s6e_efry^#+f#=1ak&s1xr-2j' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # fixme: production mode # Application definition @@ -125,6 +125,10 @@ USE_TZ = True # https://docs.djangoproject.com/en/2.0/howto/static-files/ STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, "static") + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, "media") # Email diff --git a/requirements.txt b/requirements.txt index 48f9bdd2..cd8f004f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ Django==2.0.1 django-anymail[mailgun]==1.2 paymentwall-python==1.0.7 -twilio==6.10.0 \ No newline at end of file +twilio==6.10.0 +psycopg2==2.7.3.2 \ No newline at end of file