version: '3.7'
services:
  ghostfolio:
    image: ghostfolio/ghostfolio:latest
    environment:
      DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=prefer
      NODE_ENV: production
      REDIS_HOST: redis
      REDIS_PORT: 6379
      ALPHA_VANTAGE_API_KEY: ${ALPHA_VANTAGE_API_KEY}
      COMPOSE_PROJECT_NAME: ghostfolio
      ACCESS_TOKEN_SALT: ${ACCESS_TOKEN_SALT}
      JWT_SECRET_KEY: ${JWT_SECRET_KEY}
    ports:
      - 3333:3333
    depends_on:
      - postgres

  postgres:
    image: postgres:12
    environment:
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - postgres:/var/lib/postgresql/data

  redis:
    image: redis:alpine

volumes:
  postgres:
