Overthinker / docker-compose.yml
Ashutosh-AIBOT
Deploy Django app
e5815d0
# # -----------------------------------------------------------------------------------------------------------------------------------------------------
# # Docker Compose file for Django with Nginx with Sqlite
# # ------------------------------------------------------------------------------------------------------------------------------------------------------
# version: '3.8'
# services:
# web:
# build: .
# container_name: django_web
# command: gunicorn core.wsgi:application --bind 0.0.0.0:8000
# env_file:
# - .env
# volumes:
# - .:/app
# - ./db.sqlite3:/app/db.sqlite3
# - ./staticfiles:/app/staticfiles
# expose:
# - "8000"
# restart: unless-stopped
# networks:
# - django-network
# nginx:
# image: nginx:latest
# container_name: django_nginx
# ports:
# - "80:80"
# volumes:
# - ./nginx/local.conf:/etc/nginx/conf.d/default.conf
# - ./staticfiles:/staticfiles
# depends_on:
# - web
# restart: unless-stopped
# networks:
# - django-network
# networks:
# django-network:
# driver: bridge
# -----------------------------------------------------------------------------------------------------------------------------------------------------
# Docker Compose file for Django with Nginx with Sqlite
# ------------------------------------------------------------------------------------------------------------------------------------------------------
version: '3.8'
services:
web:
build:
context: .
dockerfile: Dockerfile-django
container_name: django_web
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000
env_file:
- .env
volumes:
- .:/app
- ./db.sqlite3:/app/db.sqlite3
- ./staticfiles:/app/staticfiles
expose:
- "8000"
restart: unless-stopped
networks:
- django-network
nginx:
image: nginx:latest
container_name: django_nginx
ports:
- "80:80"
volumes:
- ./nginx/local.conf:/etc/nginx/conf.d/default.conf
- ./staticfiles:/staticfiles
depends_on:
- web
restart: unless-stopped
networks:
- django-network
networks:
django-network:
driver: bridge