ЛР3 — БВТ2302 — Никитина — на 5

This commit is contained in:
Yuliiiaaaa
2026-11-03 12:37:56 +03:00
parent 0ab3a341aa
commit dacbdd8b29
21 changed files with 1138 additions and 48 deletions
+59
View File
@@ -0,0 +1,59 @@
services:
db:
image: postgres:16.3-bookworm
environment:
POSTGRES_USER: messenger
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: messenger
volumes:
- pgdata:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U messenger"]
interval: 5s
retries: 5
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
redis:
image: redis:7.2.5-bookworm
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
api:
build: .
environment:
DATABASE_URL: postgresql://messenger:${POSTGRES_PASSWORD}@db:5432/messenger
REDIS_URL: redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
nginx:
image: nginx:1.25.5-alpine
ports:
- "127.0.0.1:8080:8080"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api
volumes:
pgdata: