Skip to content

Instantly share code, notes, and snippets.

@maxtortime
Last active March 31, 2018 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save maxtortime/d72d22dbecc27b04dffb968692e9d72d to your computer and use it in GitHub Desktop.
Save maxtortime/d72d22dbecc27b04dffb968692e9d72d to your computer and use it in GitHub Desktop.
flask-docker-compose-example
version: '2'
services:
web:
environment:
- FLASK_CONFIG=production
build: ./app/
volumes:
- .:/code
- /var/uploads/
command: gunicorn -w 2 -b :8000 manage:app
depends_on:
- redis
- postgres
redis:
image: redis:alpine
ports:
- "6379:6379"
data:
image: postgres:alpine
volumes:
- /var/lib/postgresql
command: "true"
postgres:
restart: always
image: postgres:alpine
volumes_from:
- data
ports:
- "5432:5432"
nginx:
restart: always
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
volumes_from:
- web
- certbot
links:
- web:web
depends_on:
- certbot
certbot:
image: henridwyer/docker-letsencrypt-cron
volumes:
- /certs:/certs
restart: always
environment:
- DOMAINS = example.com
- EMAIL = EMAIL@EMAIL.COM
- CONCAT = false
- SEPARATE = false
FROM python:3.5-alpine
RUN apk add --no-cache build-base libffi-dev postgresql-dev
WORKDIR /code
ADD ./requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt
ADD . /code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment