forked from mtusi2026/mtusi2026lab2
Prepare verified laboratory 2 implementation and evidence
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
name: vp-lab2-medvedev
|
||||
x-api: &api
|
||||
image: vp-medvedev-lab2:local
|
||||
build: .
|
||||
cpus: 1
|
||||
mem_limit: 512m
|
||||
stop_grace_period: 10s
|
||||
environment:
|
||||
APP_PORT: 8080
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
PG_MAX_CONNS: ${PG_MAX_CONNS:-8}
|
||||
GOMEMLIMIT: 400MiB
|
||||
secrets: [database_url, cache_url]
|
||||
depends_on:
|
||||
migrate: {condition: service_completed_successfully}
|
||||
valkey: {condition: service_started}
|
||||
networks: [private]
|
||||
services:
|
||||
restore:
|
||||
image: postgres:18.6@sha256:74935e72241653ca55e0414067e6d8763aceb8a810eb51b452253ec3dcfc4336
|
||||
profiles: [tools]
|
||||
cpus: 1
|
||||
mem_limit: 512m
|
||||
environment:
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_DB: restore
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/pg_password
|
||||
secrets: [pg_password]
|
||||
volumes: [restore:/var/lib/postgresql]
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, pg_isready -U messenger -d restore]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
networks: [private]
|
||||
postgres:
|
||||
image: postgres:18.6@sha256:74935e72241653ca55e0414067e6d8763aceb8a810eb51b452253ec3dcfc4336
|
||||
cpus: 2
|
||||
mem_limit: 768m
|
||||
environment:
|
||||
POSTGRES_USER: messenger
|
||||
POSTGRES_DB: messenger
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/pg_password
|
||||
secrets: [pg_password]
|
||||
volumes: [postgres:/var/lib/postgresql]
|
||||
healthcheck:
|
||||
test: [CMD-SHELL, pg_isready -U messenger -d messenger]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
networks: [private]
|
||||
valkey:
|
||||
image: valkey/valkey:9@sha256:418652cfb58ef879d4978c33553735d7147016032d5aefaa14c828e611eb9dfd
|
||||
cpus: 0.25
|
||||
mem_limit: 128m
|
||||
command: [valkey-server, /run/secrets/valkey_conf]
|
||||
secrets: [valkey_conf]
|
||||
volumes: [valkey:/data]
|
||||
networks: [private]
|
||||
migrate:
|
||||
image: vp-medvedev-lab2:local
|
||||
build: .
|
||||
command: [-migrate]
|
||||
cpus: 0.5
|
||||
mem_limit: 256m
|
||||
secrets: [database_url]
|
||||
depends_on:
|
||||
postgres: {condition: service_healthy}
|
||||
networks: [private]
|
||||
api:
|
||||
<<: *api
|
||||
ports: ['127.0.0.1:${PUBLIC_PORT:-28202}:8080']
|
||||
volumes:
|
||||
restore:
|
||||
postgres:
|
||||
valkey:
|
||||
networks:
|
||||
private:
|
||||
secrets:
|
||||
pg_password: {file: .local/pg_password}
|
||||
database_url: {file: .local/database_url}
|
||||
cache_url: {file: .local/cache_url}
|
||||
valkey_conf: {file: .local/valkey.conf}
|
||||
Reference in New Issue
Block a user