File size: 2,218 Bytes
aa15bce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
version: '3.8'

# Production overrides for docker-compose.yml
# Usage: docker-compose -f docker-compose.yml -f docker-compose.production.yml up

services:
  server:
    # Production-specific configurations
    environment:
      - OPENPOKE_CORS_ALLOW_ORIGINS=${PRODUCTION_CORS_ORIGINS:-https://yourdomain.com}
      - OPENPOKE_ENABLE_DOCS=0  # Disable docs in production
    deploy:
      resources:
        limits:
          cpus: '1.0'
          memory: 1G
        reservations:
          cpus: '0.5'
          memory: 512M
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "5"

  web:
    # Production-specific configurations
    deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 512M
        reservations:
          cpus: '0.25'
          memory: 256M
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
        max-file: "5"

# Optional: Add SSL termination with Traefik
  # traefik:
  #   image: traefik:v2.10
  #   command:
  #     - "--api.dashboard=true"
  #     - "--providers.docker=true"
  #     - "--providers.docker.exposedbydefault=false"
  #     - "--entrypoints.web.address=:80"
  #     - "--entrypoints.websecure.address=:443"
  #     - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
  #     - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
  #     - "--certificatesresolvers.letsencrypt.acme.email=your-email@example.com"
  #     - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
  #   ports:
  #     - "80:80"
  #     - "443:443"
  #     - "8080:8080"  # Traefik dashboard
  #   volumes:
  #     - /var/run/docker.sock:/var/run/docker.sock:ro
  #     - letsencrypt:/letsencrypt
  #   networks:
  #     - app-network
  #   labels:
  #     - "traefik.enable=true"
  #     - "traefik.http.routers.api.rule=Host(`traefik.yourdomain.com`)"
  #     - "traefik.http.routers.api.service=api@internal"

# volumes:
#   letsencrypt:
#     driver: local