File size: 1,100 Bytes
868eab0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
services:
  backend:
    build:
      context: .
      dockerfile: backend/Dockerfile
    ports:
      - "8000:8000"
    healthcheck:
      test:
        [
          "CMD",
          "python",
          "-c",
          "import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=5)",
        ]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 120s

  frontend:
    build:
      context: .
      dockerfile: frontend/Dockerfile
    environment:
      # Inside Docker Compose, localhost would point at the frontend container.
      # The backend service is reachable by its Compose service name instead.
      TRANSLATE_API_URL: http://backend:8000/translate
    ports:
      - "8501:8501"
    depends_on:
      backend:
        condition: service_healthy
    healthcheck:
      test:
        [
          "CMD",
          "python",
          "-c",
          "import urllib.request; urllib.request.urlopen('http://localhost:8501/_stcore/health', timeout=5)",
        ]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 30s