-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.integration.yml
More file actions
92 lines (88 loc) · 2.72 KB
/
Copy pathdocker-compose.integration.yml
File metadata and controls
92 lines (88 loc) · 2.72 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
# Full-stack integration test: Gitea + PostgreSQL + ccg
# Usage: make container-artifacts
# CONTAINER_ARCH=$(go env GOARCH) docker compose -f docker-compose.integration.yml up -d
# ./scripts/integration-test.sh
# docker compose -f docker-compose.integration.yml down -v
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ccg
POSTGRES_PASSWORD: ccg
POSTGRES_DB: ccg_integration
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ccg -d ccg_integration"]
interval: 2s
timeout: 5s
retries: 10
networks:
- integration
gitea:
image: gitea/gitea:1.23-rootless
environment:
# Skip installation wizard
- GITEA__security__INSTALL_LOCK=true
- GITEA__security__SECRET_KEY=integration-test-secret-key-1234567890
# Database — use SQLite internally (Gitea's own DB, not ours)
- GITEA__database__DB_TYPE=sqlite3
# Server
- GITEA__server__ROOT_URL=http://gitea:3000
- GITEA__server__HTTP_PORT=3000
- GITEA__server__DOMAIN=gitea
- GITEA__server__OFFLINE_MODE=true
# Disable registration, allow API access
- GITEA__service__DISABLE_REGISTRATION=false
- GITEA__service__REQUIRE_SIGNIN_VIEW=false
# Webhook — allow calling ccg container
- GITEA__webhook__ALLOWED_HOST_LIST=ccg
- GITEA__webhook__SKIP_TLS_VERIFY=true
ports:
- "3000:3000"
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:3000/api/v1/version"]
interval: 5s
timeout: 5s
retries: 20
start_period: 20s
networks:
- integration
ccg:
build:
context: .
dockerfile: Dockerfile
args:
TARGETARCH: ${CONTAINER_ARCH:-amd64}
environment:
- CCG_DB_DRIVER=postgres
- CCG_DB_DSN=host=postgres user=ccg password=ccg dbname=ccg_integration port=5432 sslmode=disable
- CCG_LOG_FORMAT=text
command:
- --http-addr=:8080
- --wiki-dir=/usr/share/ccg/wiki
- --http-bearer-token=test-mcp-token
- --db-driver=postgres
- --db-dsn=host=postgres user=ccg password=ccg dbname=ccg_integration port=5432 sslmode=disable
- --allow-repo=testadmin/*
- --webhook-secret=test-webhook-secret
- --repo-clone-base-url=http://gitea:3000
- --repo-root=/repos
ports:
- "18080:8080"
depends_on:
postgres:
condition: service_healthy
gitea:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/ready"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
networks:
- integration
networks:
integration:
driver: bridge