Skip to content

Commit cba97f1

Browse files
caiyanzentao
authored andcommitted
Merge branch 'release/4.4' of Pangu/gitfox-community (#3800)
2 parents 5e96109 + c7cee35 commit cba97f1

3 files changed

Lines changed: 97 additions & 33 deletions

File tree

‎deploy/Dockerfile‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,23 @@ ENV GITFOX_LOG_LEVEL=0
6161
ENV GITFOX_CI_PLUGINS_ZIP_URL=/app/ciPlugins/plugins.tar.gz
6262

6363
COPY bin/linux-${TARGETARCH}/gitfox /app/gitfox
64-
COPY configs/prod.env /app/prod.env
65-
COPY configs/prod.yaml /app/prod.yaml
64+
65+
# 默认配置模板:仅用于运行期播种到 /data
66+
COPY bin/linux-${TARGETARCH}/prod.env /app/defaults/prod.env
67+
COPY bin/linux-${TARGETARCH}/prod.yaml /app/defaults/prod.yaml
68+
6669
COPY resources/ciPlugins/plugins.tar.gz /app/ciPlugins/plugins.tar.gz
6770

6871

6972

7073
COPY --from=cert-image /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
7174

75+
COPY deploy/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
76+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
77+
7278
EXPOSE 3000
7379
EXPOSE 22
7480
EXPOSE 3322
7581

76-
CMD [ "/app/gitfox", "server", "prod" ]
82+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
83+
CMD ["server", "/data/gitfox-community/prod"]

‎deploy/docker-compose.yaml‎

Lines changed: 72 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,82 @@
11
services:
2+
zentao-db:
3+
image: hub.zentao.net/app/mysql:8.0.36-debian
4+
container_name: zentao-db
5+
ports:
6+
- '3306:3306'
7+
volumes:
8+
- /data/zentao-mysql:/var/lib/mysql
9+
environment:
10+
- MYSQL_ROOT_PASSWORD=pass4Zentao
11+
- MYSQL_DATABASE=zentao
12+
networks:
13+
- zentao-net
14+
healthcheck:
15+
test: ["CMD-SHELL", "mysqladmin ping -h127.0.0.1 -uroot -p$$MYSQL_ROOT_PASSWORD"]
16+
interval: 3s
17+
timeout: 3s
18+
retries: 10
19+
start_period: 20s
20+
zentao:
21+
image: hub.zentao.net/test/gitfox-front:4.4
22+
container_name: zentao
23+
ports:
24+
- '80:80'
25+
volumes:
26+
- /data/zentao-file:/data
27+
depends_on:
28+
zentao-db:
29+
condition: service_healthy
30+
environment:
31+
- ZT_MYSQL_HOST=zentao-db
32+
- ZT_MYSQL_PORT=3306
33+
- ZT_MYSQL_USER=root
34+
- ZT_MYSQL_PASSWORD=pass4Zentao
35+
- ZT_MYSQL_DB=zentao
36+
- PHP_MAX_EXECUTION_TIME=120
37+
- PHP_MEMORY_LIMIT=512M
38+
- PHP_POST_MAX_SIZE=128M
39+
- PHP_UPLOAD_MAX_FILESIZE=128M
40+
- ZT_GITFOX_PORT=3000
41+
- ZT_GITFOX_URL=3000
42+
- ZT_GITFOX_URL=3000
43+
- IS_CONTAINER=true
44+
networks:
45+
- zentao-net
246
gitfox:
3-
image: hub.zentao.net/app/gitfox-community:2.1-20260904
47+
image: gitfox-server:4.4-20261104
448
container_name: gitfox
5-
restart: unless-stopped
649
ports:
7-
- "3000:3000"
8-
- "3322:3322"
9-
environment:
10-
GITFOX_SERVER_PROTO: http
11-
GITFOX_SERVER_HOST: example.com
12-
GITFOX_REPO_URL_EXPOSE_PORT: true
13-
GITFOX_HTTP_PORT: 3000
14-
GITFOX_SSH_PORT: 3322
15-
GITFOX_DEVOPS_URL: http://example.com/api.php/v1
16-
# GITFOX_DB_DATASOURCE: user:password@tcp(mysql:3306)/gitfox-community?parseTime=true&loc=Local
17-
18-
GITFOX_DB_DRIVER: mysql
19-
GITFOX_DB_HOST: mysql
20-
GITFOX_DB_PORT: 3306
21-
GITFOX_DB_USER: gitfox
22-
GITFOX_DB_PASSWORD: please_change
23-
GITFOX_DB_NAME: gitfox
24-
GITFOX_DB_TIMEZONE: Asia/Shanghai
50+
- '3000:3000'
51+
- '3322:3322'
2552
volumes:
26-
- gitfox-data:/data
53+
- /data/zentao-file:/data
54+
- /var/run/docker.sock:/var/run/docker.sock
55+
depends_on:
56+
zentao-db:
57+
condition: service_healthy
58+
environment:
59+
- GITFOX_SERVER_PROTO=http
60+
- GITFOX_SERVER_HOST=example.com #当前服务器地址
61+
- GITFOX_REPO_URL_EXPOSE_PORT=true
62+
- GITFOX_HTTP_PORT=3000
63+
- GITFOX_SSH_PORT=3322
64+
- GITFOX_DEVOPS_URL=http://example.com/api.php/v1 #禅道服务器地址
65+
- GITFOX_DB_DRIVER=mysql
66+
- GITFOX_DB_HOST=zentao-db
67+
- GITFOX_DB_PORT=3306
68+
- GITFOX_DB_USER=root
69+
- GITFOX_DB_PASSWORD=pass4Zentao
70+
- GITFOX_DB_NAME=zentao
71+
- GITFOX_DB_TIMEZONE=Asia/Shanghai
2772
healthcheck:
28-
test: ["CMD", "curl", "-fsS", "http://localhost:3000/public/health"]
73+
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:3000/public/health"]
2974
interval: 5s
3075
timeout: 1s
3176
retries: 1
3277
start_period: 30s
33-
deploy:
34-
resources:
35-
limits:
36-
cpus: "1.0"
37-
memory: 1g
38-
39-
volumes:
40-
gitfox-data:
78+
networks:
79+
- zentao-net
80+
networks:
81+
zentao-net:
82+
driver: bridge

‎deploy/docker-entrypoint.sh‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
set -e
3+
4+
mkdir -p /data/gitfox-community
5+
6+
for f in prod.env prod.yaml; do
7+
if [ -d "/data/gitfox-community/$f" ]; then
8+
rm -rf "/data/gitfox-community/$f"
9+
fi
10+
if [ ! -f "/data/gitfox-community/$f" ]; then
11+
cp "/app/defaults/$f" "/data/gitfox-community/$f"
12+
fi
13+
done
14+
15+
exec /app/gitfox "$@"

0 commit comments

Comments
 (0)