-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (116 loc) · 3.46 KB
/
Copy pathdocker-compose.yml
File metadata and controls
124 lines (116 loc) · 3.46 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: opentrends
x-server-build: &server-build
context: .
dockerfile: Dockerfile.server
x-server-env: &server-env
NODE_ENV: production
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-password}@postgres:5432/${POSTGRES_DB:-opentrends}
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:?set BETTER_AUTH_SECRET in .env}
BETTER_AUTH_URL: ${BETTER_AUTH_URL:-http://localhost:3000}
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3001}
RSSHUB_BASE_URLS: ${RSSHUB_BASE_URLS:-http://rsshub:1200,rss.datuan.dev,rss.4040940.xyz,rsshub.cups.moe,rss.spriple.org,rsshub-balancer.virworks.moe,rsshub.umzzz.com,rsshub.isrss.com}
TRENDS_REFRESH_SCHEDULER: ${TRENDS_REFRESH_SCHEDULER:-enabled}
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-opentrends}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U $${POSTGRES_USER:-postgres} -d $${POSTGRES_DB:-opentrends}",
]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
rsshub:
image: diygod/rsshub:chromium-bundled
environment:
NODE_ENV: production
CACHE_TYPE: memory
CACHE_EXPIRE: "300"
ALLOW_USER_HOTLINK_TEMPLATE: "{href}"
PROXY_PROTOCOL: ""
ports:
- "${RSSHUB_PORT:-1200}:1200"
healthcheck:
test:
[
"CMD-SHELL",
"node -e \"fetch('http://127.0.0.1:1200/healthz').then((r) => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))\"",
]
interval: 10s
timeout: 5s
retries: 12
restart: unless-stopped
migrate:
image: opentrends-server:local
build: *server-build
command: ["bun", "run", "db:migrate"]
env_file:
- path: apps/server/.env.local
required: false
environment: *server-env
depends_on:
postgres:
condition: service_healthy
restart: "no"
server:
image: opentrends-server:local
build: *server-build
env_file:
- path: apps/server/.env.local
required: false
environment: *server-env
ports:
- "${SERVER_PORT:-3000}:3000"
depends_on:
postgres:
condition: service_healthy
rsshub:
condition: service_started
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1:3000/ || exit 1"]
interval: 10s
timeout: 5s
retries: 12
restart: unless-stopped
web:
image: opentrends-web:local
build:
context: .
dockerfile: Dockerfile.web
args:
VITE_SERVER_URL: ${VITE_SERVER_URL:-http://localhost:3000}
VITE_SITE_URL: ${VITE_SITE_URL:-http://localhost:3001}
environment:
NODE_ENV: production
VITE_SERVER_URL: ${VITE_SERVER_URL:-http://localhost:3000}
VITE_SITE_URL: ${VITE_SITE_URL:-http://localhost:3001}
ports:
- "${WEB_PORT:-3001}:3001"
depends_on:
server:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"bun -e \"fetch('http://127.0.0.1:3001/').then((r) => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))\"",
]
interval: 10s
timeout: 5s
retries: 12
restart: unless-stopped
volumes:
postgres_data: