WebServer/docker/docker-compose.yml
Vladislav 9bbb104749 Update 12 files
- /backend/requirements.txt
- /backend/server.py
- /conf/domain.conf
- /conf/domain.crt
- /conf/domain.key
- /docker/init.sql
- /docker/docker-compose.yml
- /docker/dockfile/nginx.conf
- /docker/dockfile/Dockerfile
- /frontend/index.html
- /post-receive
- /README.md
2025-03-20 19:22:08 +00:00

52 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

services:
DataBase:
image: postgres:latest
container_name: DataBase
ports:
- "5432:5432"
#Так никто не делает в реальных кейсах, я просто даун, не умею работать с секретами (опция secrets)
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: WebSite
volumes:
- /home/git/myprojects/database:/var/lib/postgresql/data
cpus: '0.15'
mem_limit: 256M
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin -WebSite"]
interval: 5s
timeout: 5s
retries: 5
webserver:
image: nginx:latest
container_name: WebServer
ports:
- "80:80"
- "443:443"
volumes:
- /home/git/myprojects/WorkServer/frontend:/usr/share/nginx/html
- /home/git/myprojects/WorkServer/conf:/etc/nginx/sites-available
depends_on:
- DataBase
- backend
cpus: '0.15'
mem_limit: 256M
backend:
image: python:3.9
container_name: backend_part
ports:
- "5000:5000"
volumes:
- /home/git/myprojects/WorkServer/backend:/media/backend
- /home/git/myprojects/WorkServer/frontend:/media/frontend
working_dir: /media/backend
command: >
sh -c "pip install -r requirements.txt && python server.py"
cpus: '0.35'
mem_limit: 256M