# docker-compose.railway.yml # # Local simulation of the Railway deployment topology. # Run: docker compose -f docker/docker-compose.railway.yml --env-file .env.railway up --build # # This builds and runs the app container the same way Railway will, # alongside local Postgres and Redis instances (which on Railway are # provisioned as separate managed services). name: ghostfolio_railway services: app: build: context: ../ dockerfile: Dockerfile container_name: gf-app restart: unless-stopped init: true cap_drop: - ALL security_opt: - no-new-privileges:true env_file: - ../.env.railway environment: - PORT=3333 - NODE_ENV=production ports: - "${PORT:-3333}:3333" depends_on: postgres: condition: service_healthy redis: condition: service_healthy healthcheck: test: ['CMD-SHELL', 'curl -f http://localhost:3333/api/v1/health'] interval: 10s timeout: 5s retries: 5 start_period: 40s postgres: image: postgres:15-alpine container_name: gf-postgres-railway restart: unless-stopped env_file: - ../.env.railway healthcheck: test: ['CMD-SHELL', 'pg_isready -d "$${POSTGRES_DB}" -U $${POSTGRES_USER}'] interval: 10s timeout: 5s retries: 5 ports: - "${POSTGRES_PORT:-5435}:5432" volumes: - postgres_data:/var/lib/postgresql/data redis: image: redis:alpine container_name: gf-redis-railway restart: unless-stopped env_file: - ../.env.railway command: - /bin/sh - -c - redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}" healthcheck: test: ['CMD-SHELL', 'redis-cli --pass "$${REDIS_PASSWORD}" ping | grep PONG'] interval: 10s timeout: 5s retries: 5 ports: - "${REDIS_PORT:-6379}:6379" volumes: postgres_data: