first commit
This commit is contained in:
61
docker-compose.prod.yml
Normal file
61
docker-compose.prod.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
networks:
|
||||
uzxarid:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
pg_data: null
|
||||
pycache: null
|
||||
media: null
|
||||
static: null
|
||||
|
||||
services:
|
||||
nginx:
|
||||
networks:
|
||||
- uzxarid
|
||||
ports:
|
||||
- ${PORT:-8001}:80
|
||||
volumes:
|
||||
- ./resources/layout/nginx.conf:/etc/nginx/nginx.conf
|
||||
- media:/usr/share/nginx/html/resources/media/:ro
|
||||
- static:/usr/share/nginx/html/resources/staticfiles/:ro
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/Dockerfile.nginx
|
||||
depends_on:
|
||||
- web
|
||||
web:
|
||||
networks:
|
||||
- uzxarid
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/Dockerfile.web
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- PYTHONPYCACHEPREFIX=/var/cache/pycache
|
||||
- SCRIPT=${SCRIPT:-entrypoint.sh}
|
||||
volumes:
|
||||
- media:/code/resources/media/
|
||||
- static:/code/resources/staticfiles/
|
||||
- pycache:/var/cache/pycache
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
db:
|
||||
networks:
|
||||
- uzxarid
|
||||
image: postgres:16
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_DB: ${DB_NAME:-django}
|
||||
POSTGRES_USER: ${DB_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:?Database password must be set in .env file}
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
redis:
|
||||
networks:
|
||||
- uzxarid
|
||||
restart: always
|
||||
|
||||
image: redis
|
||||
Reference in New Issue
Block a user