version: '3.8'

services:
  immich-server:
    image: ghcr.io/immich-app/immich-server:release
    container_name: immich-server
    command: start.sh
    restart: unless-stopped
    depends_on:
      - redis
      - database
    ports: 
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - DB_HOSTNAME=database
      - DB_USERNAME=postgres
      - DB_PASSWORD=YourSecurePassword123
      - DB_DATABASE_NAME=immich
      - REDIS_HOSTNAME=redis
      - IMMICH_MEDIA_LOCATION=/usr/src/app/upload
      - IMMICH_SERVER_URL=http://localhost:3000/api
      - TZ=America/New_York
    volumes:
      - /mnt/immich_data/:/usr/src/app/upload
    networks:
      - immich-network

  immich-web:
    image: ghcr.io/immich-app/immich-web:release
    container_name: immich-web
    restart: unless-stopped
    ports:
      - "8081:80"
    environment:
      - IMMICH_SERVER_URL=http://localhost:3000/api
      - TZ=America/New_York
    networks:
      - immich-network

  immich-microservices:
    image: ghcr.io/immich-app/immich-server:release
    container_name: immich-microservices
    restart: unless-stopped
    depends_on:
      - redis
      - database
      - immich-server
    environment:
      - NODE_ENV=production
      - DB_HOSTNAME=database
      - DB_USERNAME=postgres
      - DB_PASSWORD=YourSecurePassword123
      - DB_DATABASE_NAME=immich
      - REDIS_HOSTNAME=redis
      - IMMICH_MEDIA_LOCATION=/usr/src/app/upload
      - IMMICH_SERVER_URL=http://immich-server:3000/api
      - TZ=America/New_York
    volumes:
      - /mnt/immich_data/:/usr/src/app/upload
    networks:
      - immich-network

  immich-machine-learning:
    image: ghcr.io/immich-app/immich-machine-learning:release
    container_name: immich-machine-learning
    restart: unless-stopped
    environment:
      - NODE_ENV=production
      - IMMICH_MEDIA_LOCATION=/usr/src/app/upload
      - MACHINE_LEARNING_CACHE_FOLDER=/cache
      - MACHINE_LEARNING_WORKER_COUNT=1
      - TZ=America/New_York
    volumes:
      - /mnt/immich_data/:/usr/src/app/upload
      - immich-model-cache:/cache
    networks:
      - immich-network

  redis:
    image: redis:alpine
    container_name: immich-redis
    restart: unless-stopped
    networks:
      - immich-network

  database:
    image: tensorchord/pgvecto-rs:pg14-v0.2.0
    container_name: immich-postgres
    restart: unless-stopped
    environment:
      - POSTGRES_PASSWORD=YourSecurePassword123
      - POSTGRES_USER=postgres
      - POSTGRES_DB=immich
      - TZ=America/New_York
    volumes:
      - immich-pgdata:/var/lib/postgresql/data
    networks:
      - immich-network

volumes:
  immich-pgdata:
  immich-model-cache:

networks:
  immich-network:
    driver: bridge 