name: docker
services:
  backend:
    build:
      context: /home/admin/docker-projects/get-email-code
      dockerfile: backend/Dockerfile
    container_name: get-email-code-backend
    environment:
      ADMIN_TOKEN: c4412e2b5728567036483400411804fc5f76be5317f55756
      BIND: 0.0.0.0:18086
      DATABASE_URL: sqlite:///app/data/hotmail_otp_console.db
      ENABLE_BACKGROUND_POLL: "true"
      ENCRYPTION_KEY: "12345678901234567890123456789012"
      HOTMAIL_IMAP_HOST: outlook.office365.com
      HOTMAIL_IMAP_PORT: "993"
      POLL_INTERVAL_SECONDS: "60"
      RUST_LOG: info,sqlx=warn,tower_http=info,reqwest=warn
    healthcheck:
      test:
        - CMD
        - curl
        - -fsS
        - http://127.0.0.1:18086/api/health
      timeout: 5s
      interval: 30s
      retries: 3
      start_period: 15s
    networks:
      default: null
    ports:
      - mode: ingress
        host_ip: 127.0.0.1
        target: 18086
        published: "18086"
        protocol: tcp
    restart: unless-stopped
    volumes:
      - type: bind
        source: /home/admin/docker-projects/get-email-code/data
        target: /app/data
        bind:
          create_host_path: true
  frontend:
    build:
      context: /home/admin/docker-projects/get-email-code
      dockerfile: frontend/Dockerfile
    container_name: get-email-code-frontend
    depends_on:
      backend:
        condition: service_healthy
        required: true
    networks:
      default: null
    ports:
      - mode: ingress
        target: 18087
        published: "18087"
        protocol: tcp
    restart: unless-stopped
networks:
  default:
    name: get-email-code-network
