Files
mtusi2026lab5/compose.test.yaml
T

56 lines
1.5 KiB
YAML

name: messenger-lab5-test
services:
postgres:
image: postgres:17.2-alpine
environment:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: messenger_test
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "test", "-d", "messenger_test"]
interval: 2s
timeout: 3s
retries: 15
redis:
image: redis:7.4.1-alpine
command: ["redis-server", "--save", "", "--appendonly", "no"]
s3:
image: pgsty/minio:RELEASE.2026-08-04T00-00-00Z@sha256:b6bfe7239bfc83fb90d31612d9704d86039dd714f7904b3f1ad68f211e602372
command: ["server", "/data", "--address", ":9000"]
environment:
MINIO_ROOT_USER: test-root
MINIO_ROOT_PASSWORD: test-root-password
MINIO_BROWSER: "off"
tmpfs:
- /data
healthcheck:
test: ["CMD", "curl", "-fsS", "-o", "/dev/null", "http://127.0.0.1:9000/minio/health/live"]
interval: 2s
timeout: 3s
retries: 15
tests:
build:
context: .
target: test
image: mtusi-messenger-lab5-test:dev
environment:
DATABASE_URL: postgresql://test:test@postgres:5432/messenger_test?connection_limit=20
CACHE_URL: redis://redis:6379/0
S3_ENDPOINT: http://s3:9000
S3_BUCKET: messenger-test
S3_ACCESS_KEY_ID: test-root
S3_SECRET_ACCESS_KEY: test-root-password
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
s3:
condition: service_healthy