File size: 1,263 Bytes
b14a10f
 
 
 
 
 
 
d5d016f
b14a10f
 
d5d016f
b14a10f
 
 
 
 
 
 
 
 
 
 
 
 
 
d5d016f
b14a10f
 
 
 
 
 
 
 
 
 
 
 
d5d016f
b14a10f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
47
48
49
50
51
52
53
54
55
56
57
version: '3.8'

services:
  central:
    build: .
    container_name: translator-central
    ports:
      - "7860:7860"
    environment:
      - NODE_ENV=production
      - PORT=7860
      - ADMIN_ACCESS_CODE=${ADMIN_ACCESS_CODE}
      - TAILSCALE_API_KEY=${TAILSCALE_API_KEY}
    volumes:
      - ./central/logs:/app/central/logs
    restart: unless-stopped
    deploy:
      resources:
        limits:
          cpus: '1.5'
          memory: 12G
        reservations:
          cpus: '1'
          memory: 8G
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7860/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

  worker:
    build: .
    container_name: translator-worker
    command: node worker/src/index.js
    environment:
      - NODE_ENV=production
      - CENTRAL_HOST=central
      - CENTRAL_PORT=7860
    depends_on:
      central:
        condition: service_healthy
    volumes:
      - ./worker/logs:/app/worker/logs
    restart: unless-stopped
    deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 4G
        reservations:
          cpus: '0.25'
          memory: 2G

networks:
  default:
    name: translator-network