Created
August 8, 2017 20:05
-
-
Save webus/bf089e5a30c4ab13790642d890965696 to your computer and use it in GitHub Desktop.
django / caddy / docker-compose
This file contains 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
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d db caddy redis | |
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build app |
This file contains 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: | |
caddy: | |
image: abiosoft/caddy:0.10.2 | |
volumes: | |
- "./Caddyfile:/etc/Caddyfile" | |
- "./.caddy:/root/.caddy" | |
ports: | |
- "80:80" | |
- "443:443" | |
volumes_from: | |
- app | |
app: | |
volumes: | |
- "./mediafiles:/usr/src/app/mediafiles" |
This file contains 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: | |
db: | |
image: postgres:9.6 | |
environment: | |
- POSTGRES_PASSWORD=secret | |
volumes: | |
- "./data:/var/lib/postgresql/data" | |
redis: | |
image: redis:3-alpine | |
app: | |
build: . | |
depends_on: | |
- db | |
env_file: | |
- ./.app.env |
This file contains 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.3-onbuild | |
VOLUME ["/usr/src/app/staticfiles"] | |
CMD ["gunicorn", "--access-logfile", "-", "--error-logfile", "-", "-b", "0.0.0.0:8000", "app.wsgi", "-w", "4", "--preload"] | |
EXPOSE 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment