version: '3.8'

services:
  backend:
    build: ./backend
    container_name: fb-tracker-backend
    ports:
      - "3001:3000"
    volumes:
      - ./backend/server.js:/app/server.js:ro
      - /opt/docker/posttracker/data:/app/data
    environment:
      - NODE_ENV=production
      - PORT=3000
      - AUTH_USERNAME=admin
      - AUTH_PASSWORD=RQWhrqowg3rihr
    labels:
      - com.centurylinklabs.watchtower.enable=false
    restart: unless-stopped

  web:
    build: ./web
    container_name: fb-tracker-web
    ports:
      - "8081:80"
    depends_on:
      - backend
    restart: unless-stopped
    labels:
      - com.centurylinklabs.watchtower.enable=false

  sqlite-web:
    image: coleifer/sqlite-web
    container_name: fb-sqlite-web
    command:
      - sqlite_web
      - /data/tracker.db
      - --host
      - 0.0.0.0
      - --port
      - "8080"
    ports:
      - "8083:8080"
    volumes:
      - /opt/docker/posttracker/data:/data
    depends_on:
      - backend
    restart: unless-stopped
    labels:
      - com.centurylinklabs.watchtower.enable=false

volumes:
  db-data:
