Last active
March 31, 2018 22:41
-
-
Save maxtortime/d72d22dbecc27b04dffb968692e9d72d to your computer and use it in GitHub Desktop.
flask-docker-compose-example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 protected] | |
- CONCAT = false | |
- SEPARATE = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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