#
# simplified compose FOR LOCAL DEVELOPMENT.
#
# please don't use this in production: it has no database persistence and maps to tt-rss source directly.
#

services:
  db:
    image: postgres:15-alpine
    restart: unless-stopped
    env_file:
      - .env
    environment:
      - POSTGRES_USER=${TTRSS_DB_USER}
      - POSTGRES_PASSWORD=${TTRSS_DB_PASS}
      - POSTGRES_DB=${TTRSS_DB_NAME}

  app:
    image: ghcr.io/tt-rss/tt-rss:latest
    environment:
      SKIP_RSYNC_ON_STARTUP: true
    build:
      dockerfile: .docker/app/Dockerfile
      context: .
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - .:/var/www/html/tt-rss
    depends_on:
      - db

  updater:
    image: ghcr.io/tt-rss/tt-rss:latest
    build:
      dockerfile: .docker/app/Dockerfile
      context: .
    restart: unless-stopped
    env_file:
      - .env
    volumes:
      - .:/var/www/html/tt-rss
    depends_on:
      - app
    command: /opt/tt-rss/updater.sh

  web-nginx:
    image: ghcr.io/tt-rss/tt-rss-web-nginx:latest
    build:
      dockerfile: .docker/web-nginx/Dockerfile
      context: .
    restart: unless-stopped
    env_file:
      - .env
    ports:
      - ${HTTP_PORT}:80
    volumes:
      - .:/var/www/html/tt-rss:ro
    depends_on:
      - app
