File size: 834 Bytes
75557db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
version: '3.8'

services:
  ai-service:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: faceid-ai-service
    ports:
      - "8000:7860" # Áp dụng port 8000 ở host ánh xạ vào port 7860 của container để test local bình thường
    env_file:
      - .env # Load các biến môi trường cấu hình thực tế từ file .env cục bộ
    environment:
      - PORT=7860
      - HOST=0.0.0.0
    restart: unless-stopped
    healthcheck:
      # Sử dụng python3 có sẵn trong container để test healthcheck thay vì dùng curl/wget (thường không có sẵn trong ảnh slim)
      test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:7860/api/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s