+ добавила функционал на 4 + тесты
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
x-lab-number: 2
|
||||
x-required-roles:
|
||||
- api
|
||||
# - postgres
|
||||
|
||||
# Лабораторная 2. API + Redis
|
||||
services:
|
||||
redis:
|
||||
image: redis:7.4.1-alpine
|
||||
container_name: mtusi-redis
|
||||
command: ["redis-server", "--appendonly", "yes", "--appendfsync", "everysec", "--save", "60", "1"]
|
||||
ports:
|
||||
- "127.0.0.1:6379:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
restart: unless-stopped
|
||||
|
||||
api:
|
||||
build: .
|
||||
image: mtusi-messenger:lab2
|
||||
container_name: mtusi-messenger-lab2
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
env_file:
|
||||
- .env
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready').read()"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
redis-data:
|
||||
Reference in New Issue
Block a user