WIP: Docker updates #13
2 changed files with 30 additions and 22 deletions
|
@ -1,38 +1,42 @@
|
|||
version: '3.8'
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
# Django app service
|
||||
web:
|
||||
build:
|
||||
context: ./
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
command: gunicorn dynamicweb.wsgi:application --bind [::]:8000
|
||||
container_name: dynamicweb
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
volumes:
|
||||
- static_volume:/data/app/app/static
|
||||
- media_volume:/data/app/app/media
|
||||
expose:
|
||||
- 8000
|
||||
env_file:
|
||||
- ./.env
|
||||
- .:/app
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
# PostgreSQL database service
|
||||
db:
|
||||
image: postgres:13.0-alpine
|
||||
image: postgres:13
|
||||
container_name: my_postgres_db
|
||||
environment:
|
||||
POSTGRES_USER: your_postgres_username
|
||||
POSTGRES_PASSWORD: your_postgres_password
|
||||
POSTGRES_DB: your_database_name
|
||||
volumes:
|
||||
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
- postgres_data:/data/var/lib/postgresql/data/
|
||||
env_file:
|
||||
- ./.env
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
# Nginx service
|
||||
nginx:
|
||||
build: ./nginx
|
||||
image: nginx:latest
|
||||
container_name: my_nginx_server
|
||||
volumes:
|
||||
- static_volume:/data/app/app/static
|
||||
- media_volume:/data/app/app/media
|
||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
- 1337:80
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
static_volume:
|
||||
media_volume:
|
||||
|
||||
|
|
|
@ -239,8 +239,12 @@ CMS_TEMPLATES = (
|
|||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'app',
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'your_database_name',
|
||||
'USER': 'your_postgres_username',
|
||||
'PASSWORD': 'your_postgres_password',
|
||||
'HOST': 'db',
|
||||
'PORT': '5432'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue