выполненная лаб2
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
name: mtusi_lab2_solution
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16.10-alpine
|
||||
environment:
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
|
||||
secrets: [db_password]
|
||||
volumes: [pgdata:/var/lib/postgresql/data]
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, 'pg_isready -U messenger -d messenger']
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
redis:
|
||||
image: redis:7.4.6-alpine
|
||||
command: [redis-server, --appendonly, 'yes', --appendfsync, everysec]
|
||||
volumes: [redisdata:/data]
|
||||
healthcheck:
|
||||
test: [CMD, redis-cli, ping]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
postgres_restore:
|
||||
image: postgres:16.10-alpine
|
||||
profiles: [research]
|
||||
environment:
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_DB: research_restored
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
|
||||
secrets: [db_password]
|
||||
volumes: [restoredata:/var/lib/postgresql/data]
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, 'pg_isready -U messenger -d research_restored']
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
api:
|
||||
build: .
|
||||
environment:
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
CACHE_URL_FILE: /run/secrets/cache_url
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
secrets: [database_url, cache_url]
|
||||
ports: ['127.0.0.1:8080:8080']
|
||||
depends_on:
|
||||
postgres: {condition: service_healthy}
|
||||
redis: {condition: service_healthy}
|
||||
healthcheck:
|
||||
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready', timeout=4)"]
|
||||
interval: 3s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
volumes:
|
||||
pgdata:
|
||||
redisdata:
|
||||
restoredata:
|
||||
secrets:
|
||||
db_password: {file: ./secrets/db_password}
|
||||
database_url: {file: ./secrets/database_url}
|
||||
cache_url: {file: ./secrets/cache_url}
|
||||
Reference in New Issue
Block a user