Skip to content

Instantly share code, notes, and snippets.

@epicserve
Forked from jefftriplett/.dockerignore
Last active December 27, 2017 22:58
Show Gist options
  • Save epicserve/614c4a81e9d714277bb073edaf49045f to your computer and use it in GitHub Desktop.
Save epicserve/614c4a81e9d714277bb073edaf49045f to your computer and use it in GitHub Desktop.
How I use Docker and Compose
.*
!.coveragerc
!.env
!.pylintrc
DEBUG=on
SECRET_KEY='*******************************'
DATABASE_URL=postgres://postgres@postgres/postgres
EMAIL_HOST='smtp.gmail.com'
EMAIL_HOST_USER='epicserve@gmail.com'
EMAIL_HOST_PASSWORD='*************'
DEFAULT_FROM_EMAIL="Brent O'Connor <brent@epicserve.com>"
version: '2'
services:
postgres:
container_name: oakgrove-postgres-db
restart: always
image: postgres:latest
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data/
redis:
image: redis:3.0
web:
container_name: oakgrove-web
build:
context: .
dockerfile: Dockerfile
# user: django
depends_on:
- postgres
- redis
restart: always
ports:
- "8000:8000"
env_file: .env-docker
volumes:
- .:/src
volumes:
postgres_data:
#!/bin/bash
# apply database migrations
python manage.py migrate --noinput
# collect static files
python manage.py collectstatic --noinput
python manage.py runserver 0.0.0.0:8000
FROM python:3.6.3
# This prevents Python from writing out pyc files
ENV PYTHONDONTWRITEBYTECODE 1
# This keeps Python from buffering stdin/stdout
ENV PYTHONUNBUFFERED 1
EXPOSE 8000
WORKDIR /src
COPY Pipfile /src/Pipfile
COPY Pipfile.lock /src/Pipfile.lock
RUN mkdir -p /src/assets \
&& mkdir -p /src/logs \
&& chmod 755 /src \
&& pip install pipenv \
&& cd /src && pipenv install --dev --deploy --system
COPY . /src/
CMD ["/src/docker-entrypoint.sh", "-n"]
[[source]]
name = "pypi"
verify_ssl = true
url = "https://pypi.python.org/simple"
[requires]
python_full_version = "3.6.3"
[dev-packages]
"fabric3" = "<1.14,>=1.13.1.post1"
"flake8" = "<3.6,>=3.5.0"
coverage = "<4.5,>=4.4.2"
django-debug-toolbar = "<1.10,>=1.9.1"
ipdb = "<0.11,>=0.10.3"
ipython = "<6.3,>=6.2.1"
isort = "<4.3,>=4.2.15"
sphinx-autobuild = "<0.8,>=0.7.1"
sphinx-rtd-theme = "<0.3,>=0.2.4"
[packages]
"psycopg2" = "<2.8,>=2.7.3.2"
django = "<2.0,>=1.11"
django-allauth = "<0.35,>=0.34.0"
django-bootstrap-form = "<3.4,>=3.3"
django-compressor = "<2.3,>=2.2"
django-environ = "<0.5,>=0.4.4"
gunicorn = "<19.8,>=19.7.1"
dj-static = "<0.1,>=0.0.6"
wagtail = "*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment