services:
  linkwarden-postgres:
    container_name: linkwarden-postgres
    image: postgres:16-alpine
    env_file: .env
    restart: always
    networks:
      - linkwarden
    volumes:
      - ./pgdata:/var/lib/postgresql/data
  
  linkwarden:
    image: ghcr.io/linkwarden/linkwarden:latest
    container_name: linkwarden
    env_file: .env
    environment:
      - DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@linkwarden-postgres:5432/postgres
    restart: always
    ports:
      - 3232:3000
    networks:
      - linkwarden
      - reverse-proxy
    volumes:
      - ./data:/data/data
    depends_on:
      - linkwarden-postgres

networks:
  linkwarden:
    name: linkwarden
  reverse-proxy:
    external: true
