diff --git a/.env.example b/.env.example deleted file mode 100644 index 463e6501685957e12934c121ac041a819d0a6265..0000000000000000000000000000000000000000 --- a/.env.example +++ /dev/null @@ -1,9 +0,0 @@ -SECRET_KEY='7t^^#zw41ol8v*to-ti*jx7)iq@-=l9jquq1!5f!e02o!j2xyu' -DEBUG="True" -ALLOWED_HOSTS="*" -DB_NAME="realestate" -DB_USER="realestate" -DB_PASSWORD="password" -DB_HOST="localhost" -APP_HOST="localhost" -#SECURE_COOKIES="False" diff --git a/.gitignore b/.gitignore index bf4197102534e30a9ec54bb8cb1b152ff766d08e..e37e8c508153462b320ff7e35f2db73ba5d8609d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ -*.swp -*.swo +*.sw[p|o] *~ ~* *.pyc -.vagrant -.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3c3acbb26d658389b761dcdee7f026da92cebb79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:jessie +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && \ + apt-get install -y python3 python3-dev python3-pip python3-psycopg2 && \ + apt-get clean +COPY ./ /app +WORKDIR /app +RUN pip3 install --requirement requirements.txt +CMD [ "gunicorn" ] diff --git a/Procfile b/Procfile deleted file mode 100644 index fe5d7ebe25b0266cee9c1b5500abda2a49dcd9ff..0000000000000000000000000000000000000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -app: gunicorn diff --git a/README.rst b/README.rst index dcd8fabad10f3151889b9f451b0ceece033888a0..f80224ad00f546fd2d40b5139edb3ead2a61c665 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ django-realestate -***************** +################# A Django application for managing real estate listings. This is also an exercise in building a 12-factor application. @@ -15,7 +15,4 @@ Usage TODO ---- -- Provisioning (Fabric for DB hosts, App hosts, maybe Cache hosts, using - environment variables, SystemD service for App with setting under - /etc/default). -- Investigate default environment in Honcho. +- Better workflow with Docker Compose (for example, migrations and testing). diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 5cb32877c5b5adf31eda2191d36f2d80a2b1c8f0..0000000000000000000000000000000000000000 --- a/Vagrantfile +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure(2) do |config| - config.vm.box = "debian/jessie64" - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.provision "shell", inline: <<-SHELL - sudo apt-get update - sudo apt-get install -yf postgresql redis-server - SHELL -end diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..47b7b82e97686aa7a698a88baf2b97dd72f0721d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +app: + build: . + ports: + - 80:80 + environment: + SECRET_KEY: '7t^^#zw41ol8v*to-ti*jx7)iq@-=l9jquq1!5f!e02o!j2xyu' + DEBUG: True + ALLOWED_HOSTS: * + DB_NAME: realestate + DB_USER: realestate + DB_PASSWORD: password + DB_HOST: localhost + APP_HOST: localhost + volumes: + - ./:/app + links: + - db + - redis +db: + image: postgres + environment: + POSTGRES_PASSWORD: password + POSTGRES_USER: realestate + POSTGRES_DB: realestate +redis: diff --git a/fabfile.py b/fabfile.py deleted file mode 100755 index 254bd524044b5f3f17a3efe100ae7f4a4dafc9eb..0000000000000000000000000000000000000000 --- a/fabfile.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 -from fabric.api import env, task, hosts -import os - - -env.use_ssh_config = True - - -@task -@hosts(os.environ['APP_HOST']) -def deploy(): - raise NotImplemented diff --git a/requirements.txt b/requirements.txt index 4ab59e74faf6c0ef7966ff36628b0b705aa9f030..0a2e68624a515947f5a7568910dc3fdf3e2dc311 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ Django>=1.8 gunicorn -honcho -fabric