-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
178 lines (170 loc) · 5.77 KB
/
docker-compose.yml
File metadata and controls
178 lines (170 loc) · 5.77 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
services:
tests:
build:
context: .
volumes:
- ./src:/usr/local/src/src
- ./tests:/usr/local/src/tests
- ./phpunit.xml:/usr/local/src/phpunit.xml
- gitea-data:/data:ro
- forgejo-data:/forgejo-data:ro
- gogs-data:/gogs-data:ro
environment:
- TESTS_GITHUB_PRIVATE_KEY
- TESTS_GITHUB_APP_IDENTIFIER
- TESTS_GITHUB_INSTALLATION_ID
- TESTS_GITEA_URL=http://gitea:3000
- TESTS_GITEA_REQUEST_CATCHER_URL=http://request-catcher:5000
- TESTS_FORGEJO_URL=http://forgejo:3000
- TESTS_GOGS_URL=http://gogs:3000
depends_on:
gitea:
condition: service_healthy
gitea-bootstrap:
condition: service_completed_successfully
forgejo:
condition: service_healthy
forgejo-bootstrap:
condition: service_completed_successfully
gogs:
condition: service_healthy
gogs-bootstrap:
condition: service_completed_successfully
request-catcher:
condition: service_started
gitea:
image: gitea/gitea:1.21.5
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=sqlite3
- GITEA__security__INSTALL_LOCK=true
- GITEA__webhook__ALLOWED_HOST_LIST=*
- GITEA__webhook__SKIP_TLS_VERIFY=true
- GITEA__webhook__DELIVER_TIMEOUT=10
- GITEA__server__LOCAL_ROOT_URL=http://gitea:3000/
ports:
- "3000:3000"
volumes:
- gitea-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
gitea-bootstrap:
image: gitea/gitea:1.21.5
volumes:
- gitea-data:/data
depends_on:
gitea:
condition: service_healthy
entrypoint: /bin/sh
environment:
- GITEA_ADMIN_USERNAME=${GITEA_ADMIN_USERNAME:-utopia}
- GITEA_ADMIN_PASSWORD=${GITEA_ADMIN_PASSWORD:-password}
- GITEA_ADMIN_EMAIL=${GITEA_ADMIN_EMAIL:-utopia@example.com}
command: >
-c "
su git -c \"gitea admin user create --username $$GITEA_ADMIN_USERNAME --password $$GITEA_ADMIN_PASSWORD --email $$GITEA_ADMIN_EMAIL --admin --must-change-password=false\" || true &&
if [ ! -f /data/gitea/token.txt ]; then
TOKEN=$$(su git -c \"gitea admin user generate-access-token --username $$GITEA_ADMIN_USERNAME --token-name $$GITEA_ADMIN_USERNAME-token --scopes all --raw\") &&
echo $$TOKEN > /data/gitea/token.txt;
fi
"
request-catcher:
image: appwrite/requestcatcher:1.1.0
ports:
- "5000:5000"
forgejo:
image: codeberg.org/forgejo/forgejo:9
environment:
- USER_UID=1000
- USER_GID=1000
- FORGEJO__database__DB_TYPE=sqlite3
- FORGEJO__security__INSTALL_LOCK=true
- FORGEJO__webhook__ALLOWED_HOST_LIST=*
- FORGEJO__webhook__SKIP_TLS_VERIFY=true
- FORGEJO__webhook__DELIVER_TIMEOUT=10
- FORGEJO__server__LOCAL_ROOT_URL=http://forgejo:3000/
volumes:
- forgejo-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
forgejo-bootstrap:
image: codeberg.org/forgejo/forgejo:9
volumes:
- forgejo-data:/data
depends_on:
forgejo:
condition: service_healthy
entrypoint: /bin/sh
environment:
- FORGEJO_ADMIN_USERNAME=${FORGEJO_ADMIN_USERNAME:-utopia}
- FORGEJO_ADMIN_PASSWORD=${FORGEJO_ADMIN_PASSWORD:-password}
- FORGEJO_ADMIN_EMAIL=${FORGEJO_ADMIN_EMAIL:-utopia@example.com}
command: >
-c "
su git -c \"forgejo admin user create --username $$FORGEJO_ADMIN_USERNAME --password $$FORGEJO_ADMIN_PASSWORD --email $$FORGEJO_ADMIN_EMAIL --admin --must-change-password=false\" || true &&
if [ ! -f /data/gitea/token.txt ]; then
TOKEN=$$(su git -c \"forgejo admin user generate-access-token --username $$FORGEJO_ADMIN_USERNAME --token-name $$FORGEJO_ADMIN_USERNAME-token --scopes all --raw\") &&
echo $$TOKEN > /data/gitea/token.txt;
fi
"
gogs:
image: gogs/gogs:0.14
volumes:
- gogs-data:/data
- ./resources/gogs/app.ini:/data/gogs/conf/app.ini
ports:
- "3002:3000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
gogs-bootstrap:
image: gogs/gogs:0.14
volumes:
- gogs-data:/data
- ./resources/gogs/app.ini:/data/gogs/conf/app.ini
depends_on:
gogs:
condition: service_healthy
entrypoint: /bin/sh
environment:
- GOGS_ADMIN_USERNAME=${GOGS_ADMIN_USERNAME:-utopia}
- GOGS_ADMIN_PASSWORD=${GOGS_ADMIN_PASSWORD:-password}
- GOGS_ADMIN_EMAIL=${GOGS_ADMIN_EMAIL:-utopia@example.com}
command:
- -c
- |
USER=git /app/gogs/gogs admin create-user \
--admin \
--name $$GOGS_ADMIN_USERNAME \
--password $$GOGS_ADMIN_PASSWORD \
--email $$GOGS_ADMIN_EMAIL \
--config /data/gogs/conf/app.ini || true
if [ ! -f /data/gogs/token.txt ]; then
sleep 2
TOKEN=$$(curl -s \
-X POST \
-u $$GOGS_ADMIN_USERNAME:$$GOGS_ADMIN_PASSWORD \
-H "Content-Type: application/json" \
-d "{\"name\":\"bootstrap\"}" \
http://gogs:3000/api/v1/users/$$GOGS_ADMIN_USERNAME/tokens \
| grep -o '"sha1":"[^"]*"' | cut -d'"' -f4)
if [ -z "$$TOKEN" ]; then echo "Failed to get token"; exit 1; fi
mkdir -p /data/gogs
echo $$TOKEN > /data/gogs/token.txt
fi
volumes:
gitea-data:
forgejo-data:
gogs-data: