Files
Nele-Till-Hochzeit/docker-compose.yml
T

74 lines
1.5 KiB
YAML

services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: wedding-app
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
env_file:
- .env
volumes:
- ./test-media:/media:ro
- wedding-cache:/cache
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- wedding-net
postgres:
image: postgres:16.4-alpine
container_name: wedding-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- wedding-pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
networks:
- wedding-net
redis:
image: redis:7.4-alpine
container_name: wedding-redis
restart: unless-stopped
command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru
volumes:
- wedding-redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.5"
memory: 192M
networks:
- wedding-net
volumes:
wedding-pgdata:
wedding-redis:
wedding-cache:
networks:
wedding-net:
driver: bridge