~cytrogen/srht-deploy

srht-deploy/compose.yaml -rw-r--r-- 2.4 KiB
6b7b1351 — Cytrogen 修复 README 里的 Markdown 格式错误 9 days ago
                                                                                
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
110
111
112
113
114
115
116
117
118
119
services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
    volumes:
      - postgres_data:/var/lib/postgresql/data
      - ./postgres_sh:/docker-entrypoint-initdb.d
    deploy:
      resources:
        limits:
          memory: 256M
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    restart: unless-stopped
    command: redis-server --maxmemory 48mb --maxmemory-policy allkeys-lru
    deploy:
      resources:
        limits:
          memory: 64M
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

  meta:
    build: ./meta-custom
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
    ports:
      - "127.0.0.1:5001:8080"
    volumes:
      - ./config:/etc/sr.ht
      - meta_data:/var/lib/meta.sr.ht
    deploy:
      resources:
        limits:
          memory: 256M

  git:
    build: ./git-custom
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
      meta:
        condition: service_started
    ports:
      - "127.0.0.1:5003:8080"
      - "0.0.0.0:22222:22"
    volumes:
      - ./config:/etc/sr.ht
      - git_data:/var/lib/git.sr.ht
      - git_repos:/var/lib/git
    deploy:
      resources:
        limits:
          memory: 256M

  todo:
    build: ./todo-custom
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
      meta:
        condition: service_started
    ports:
      - "127.0.0.1:5004:8080"
    volumes:
      - ./config:/etc/sr.ht
      - todo_data:/var/lib/todo.sr.ht
    deploy:
      resources:
        limits:
          memory: 256M

  hub:
    build: ./hub-custom
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
      meta:
        condition: service_started
    ports:
      - "127.0.0.1:5002:8080"
    volumes:
      - ./config:/etc/sr.ht
    deploy:
      resources:
        limits:
          memory: 256M

volumes:
  postgres_data:
  meta_data:
  git_data:
  git_repos:
  todo_data: