/ opencodehub / docker-compose.yml
swadhinbiswas feat: implement air-gapped mode, UI fixes, and project management integrations · 7/9/2026
e3bd4a1
109 lines · 2.7 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
services:
  # Main OpenCodeHub application
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: opencodehub
    restart: unless-stopped
    ports:
      - "4321:4321" # Web interface
      - "2222:2222" # SSH Git
    environment:
      - NODE_ENV=production
      - DATABASE_URL=postgresql://opencodehub:opencodehub@postgres:5432/opencodehub
      - DATABASE_TYPE=postgres
      - REDIS_URL=redis://redis:6379
      - JWT_SECRET=${JWT_SECRET:-supersecretjwtkey}
      - WORKFLOW_SECRET_ENCRYPTION_KEY=${WORKFLOW_SECRET_ENCRYPTION_KEY:-0123456789abcdef0123456789abcdef}
      - SERVER_URL=http://localhost:4321
      - DATA_DIR=/data
      - STORAGE_TYPE=local
    volumes:
      - ./data/opencodehub:/data
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
    networks:
      - opencodehub-network
    healthcheck:
      test:
        [
          "CMD",
          "wget",
          "--no-verbose",
          "--tries=1",
          "--spider",
          "http://localhost:4321/api/health",
        ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

  # PostgreSQL database
  postgres:
    image: docker.io/library/postgres:16-alpine
    container_name: opencodehub-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: opencodehub
      POSTGRES_PASSWORD: opencodehub
      POSTGRES_DB: opencodehub
    volumes:
      - ./data/postgres:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      - opencodehub-network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U opencodehub -d opencodehub"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Redis for caching and sessions
  redis:
    image: docker.io/library/redis:7-alpine
    container_name: opencodehub-redis
    restart: unless-stopped
    command: redis-server --appendonly yes
    volumes:
      - ./data/redis:/data
    ports:
      - "6379:6379"
    networks:
      - opencodehub-network
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Pipeline runner (for CI/CD jobs)
  runner:
    build:
      context: .
      dockerfile: Dockerfile.runner
    container_name: opencodehub-runner
    restart: unless-stopped
    privileged: true # Required for Docker-in-Docker
    environment:
      - RUNNER_TOKEN=${RUNNER_TOKEN:-}
      - SERVER_URL=http://app:4321
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./data/runner/work:/work
      - ./data/runner/cache:/cache
    depends_on:
      - app
    networks:
      - opencodehub-network

networks:
  opencodehub-network:
    driver: bridge