File size: 1,009 Bytes
20c5151
 
 
65f788b
 
 
 
 
 
20c5151
 
 
 
 
 
65f788b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20c5151
65f788b
20c5151
65f788b
20c5151
65f788b
 
 
 
 
 
 
 
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
version: '3.8'

services:
  fitness-app:
    build:
      context: .
      dockerfile: Dockerfile
      target: production
    container_name: fitness-app
    ports:
      - "7860:7860"
    environment:
      - NODE_ENV=production
      - PORT=7860
    restart: unless-stopped
    
    # Volume for persistent data (optional - if you want to persist user data)
    # volumes:
    #   - ./data:/app/data
    
    # Resource limits (adjust based on your needs)
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 512M
        reservations:
          cpus: '0.5'
          memory: 256M
    
    # Health check
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://localhost:7860/', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 15s
    
    # Logging configuration
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"