fixed docker
This commit is contained in:
parent
741aefca31
commit
c334c0628d
8 changed files with 206 additions and 40 deletions
|
|
@ -1,3 +1,5 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:14
|
||||
|
|
@ -7,24 +9,40 @@ services:
|
|||
POSTGRES_PASSWORD: mypass
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- app_network
|
||||
|
||||
web:
|
||||
build: .
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./static:/static:rw
|
||||
- ./media:/media:rw
|
||||
env_file: .env
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
- DB_NAME=mydb
|
||||
- DB_USER=myuser
|
||||
- DB_PASSWORD=mypass
|
||||
- DB_HOST=db
|
||||
- DB_PORT=5432
|
||||
networks:
|
||||
- app_network
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./static:/var/www/static
|
||||
- ./media:/var/www/media
|
||||
depends_on:
|
||||
- web
|
||||
networks:
|
||||
- app_network
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
static_volume:
|
||||
media_volume:
|
||||
|
||||
networks:
|
||||
app_network:
|
||||
driver: bridge
|
||||
Loading…
Add table
Add a link
Reference in a new issue