File size: 2,361 Bytes
a4f8c46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
58
59
60
61
62
version: "3.9"

# ── NeuroCheck v8.0 β€” Docker Compose ─────────────────────────────────────────
# Usage:
#   docker compose up           β†’ start everything
#   docker compose up --build   β†’ rebuild and start
#   docker compose down         β†’ stop and remove containers

services:

  # ── API Server ──────────────────────────────────────────────────────────────
  api:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: neurocheck-api
    restart: unless-stopped
    ports:
      - "8000:8000"
    environment:
      - SPACY_MODEL=/app/en_model
      - PORT=8000
    healthcheck:
      test: ["CMD", "python3", "-c",
             "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    volumes:
      # Mount source for hot-reload during development
      - ./api:/app/api:ro
      - ./frontend:/app/frontend:ro
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.neurocheck.rule=Host(`neurocheck.yourdomain.com`)"
      - "traefik.http.routers.neurocheck.tls=true"
      - "traefik.http.routers.neurocheck.tls.certresolver=letsencrypt"

  # ── Reverse Proxy (optional β€” for production with HTTPS) ────────────────────
  # Uncomment this block to enable Traefik with automatic Let's Encrypt SSL.
  # Update the domain in the api service labels above.
  #
  # proxy:
  #   image: traefik:v3.0
  #   container_name: traefik
  #   restart: unless-stopped
  #   ports:
  #     - "80:80"
  #     - "443:443"
  #   volumes:
  #     - /var/run/docker.sock:/var/run/docker.sock:ro
  #     - ./traefik/acme.json:/acme.json
  #   command:
  #     - "--providers.docker=true"
  #     - "--providers.docker.exposedbydefault=false"
  #     - "--entrypoints.web.address=:80"
  #     - "--entrypoints.websecure.address=:443"
  #     - "--certificatesresolvers.letsencrypt.acme.email=your@email.com"
  #     - "--certificatesresolvers.letsencrypt.acme.storage=/acme.json"
  #     - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"