forked from mtusi2026/mtusi2026lab3
create tasks from 5
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
api:
|
||||
image: hla-swarm-registry:5000/hla-lab3-api:swarm
|
||||
environment:
|
||||
APP_HOST: 0.0.0.0
|
||||
APP_PORT: 8080
|
||||
DATABASE_URL: jdbc:postgresql://hla-state_postgres:5432/${DATABASE_NAME:-messenger}
|
||||
DATABASE_USER: ${DATABASE_USER:-messenger}
|
||||
DATABASE_PASSWORD: ${DATABASE_PASSWORD:?DATABASE_PASSWORD is required}
|
||||
DATABASE_POOL_SIZE: 10
|
||||
DATABASE_MIN_IDLE: 2
|
||||
DATABASE_QUERY_TIMEOUT_SECONDS: 5
|
||||
DATABASE_TRANSACTION_TIMEOUT_SECONDS: 5
|
||||
REDIS_HOST: hla-state_redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_CONNECT_TIMEOUT: 1s
|
||||
REDIS_COMMAND_TIMEOUT: 500ms
|
||||
SESSION_TTL_SECONDS: 3600
|
||||
USER_CACHE_TTL_SECONDS: 300
|
||||
IDEMPOTENCY_TTL_SECONDS: 86400
|
||||
FLYWAY_ENABLED: "false"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "--fail", "--silent", "http://localhost:8080/health/ready"]
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 20
|
||||
start_period: 45s
|
||||
networks: [backend]
|
||||
deploy:
|
||||
replicas: 2
|
||||
endpoint_mode: dnsrr
|
||||
placement:
|
||||
max_replicas_per_node: 1
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 2s
|
||||
update_config:
|
||||
parallelism: 1
|
||||
order: start-first
|
||||
monitor: 15s
|
||||
failure_action: rollback
|
||||
rollback_config:
|
||||
parallelism: 1
|
||||
order: stop-first
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.75"
|
||||
memory: 768M
|
||||
|
||||
nginx:
|
||||
image: hla-swarm-registry:5000/hla-lab3-nginx:swarm
|
||||
ports:
|
||||
- target: 80
|
||||
published: 8080
|
||||
protocol: tcp
|
||||
mode: ingress
|
||||
networks: [backend]
|
||||
deploy:
|
||||
replicas: 1
|
||||
placement:
|
||||
constraints:
|
||||
- node.labels.hla.lb == true
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
resources:
|
||||
limits:
|
||||
cpus: "0.25"
|
||||
memory: 128M
|
||||
|
||||
networks:
|
||||
backend:
|
||||
external: true
|
||||
name: hla-state_backend
|
||||
Reference in New Issue
Block a user