Deploy client-cms to caddy container
Some checks failed
Client CMS Check Build (NixCN CMS) TeamCity build failed
Backend Check Build (NixCN CMS) TeamCity build finished

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-29 12:52:32 +08:00
parent 5ece89268f
commit fabba842ce
17 changed files with 43 additions and 22 deletions

9
deploy/Caddyfile Normal file
View File

@@ -0,0 +1,9 @@
test.nix.org.cn {
handle /api/* {
reverse_proxy backend:8000
}
handle {
reverse_proxy client-cms:3000
}
}

View File

@@ -0,0 +1,6 @@
:3000 {
root * /srv
encode zstd gzip
try_files {path} /index.html
file_server
}

100
deploy/conpose.yaml Normal file
View File

@@ -0,0 +1,100 @@
services:
postgres:
image: docker.io/postgres:18-alpine
container_name: cms-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- ./data/postgres:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: docker.io/redis:8-alpine
container_name: cms-redis
volumes:
- ./data/redis:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 5s
timeout: 3s
retries: 5
meilisearch:
image: getmeili/meilisearch:v1.34.3
container_name: cms-search
environment:
- MEILI_MASTER_KEY=your_master_key
volumes:
- ./data/meilisearch:/meili_data
healthcheck:
test:
["CMD-SHELL", "curl -f http://localhost:7700/health || exit 1"]
interval: 5s
timeout: 3s
retries: 10
lgtm:
image: grafana/otel-lgtm:latest
container_name: lgtm-stack
ports:
- "3000:3000"
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
volumes:
- ./data/lgtm:/data
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:3000/api/health || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
caddy:
image: docker.io/caddy:latest
container_name: caddy-proxy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./data/caddy/data:/data
- ./data/caddy/config:/config
depends_on:
- backend
- client-cms
client-cms:
image: registry.asnk.io/nixcn-cms/client-cms:dev
container_name: cms-client
restart: always
depends_on:
lgtm:
condition: service_healthy
backend:
image: registry.asnk.io/nixcn-cms/backend:dev
container_name: cms-backend
restart: always
volumes:
- ./config.yaml:/app/config.yaml:ro
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
meilisearch:
condition: service_healthy
lgtm:
condition: service_healthy