Files
gitea_init/docker-compose.yml
2026-04-08 11:47:27 +08:00

60 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3'
networks:
gitea_network:
external: true
services:
caddy_service:
image: caddy
container_name: caddy_container
restart: always
environment:
- TZ=Asia/Shanghai
volumes:
- "./Caddyfile:/etc/caddy/Caddyfile"
- "./conf/:/etc/caddy/conf/"
# - "/home/dj_docker/code/staticfiles/ : /var/www/dj_docker/staticfiles/"
ports:
- "80:80"
- "443:443"
expose:
- "8080"
- "5000"
- "8000"
- "8888"
stdin_open: true
tty: true
privileged: true
networks:
- "gitea_network"
gitea_service:
image: docker.xuanyuan.run/gitea/gitea:latest # 或 rootless 版本
container_name: gitea_container
depends_on:
- caddy_service
restart: unless-stopped
environment:
- USER_UID=1000
- USER_GID=1000
# 数据库(默认 SQLite无需额外服务
- GITEA__database__DB_TYPE=sqlite3
- GITEA__database__PATH=/data/gitea/gitea.db
# 站点
- GITEA__server__DOMAIN=gitea.vlos.net
- GITEA__server__ROOT_URL=https://gitea.vlos.net
- GITEA__server__HTTP_PORT=3000
- GITEA__server__SSH_PORT=222
- GITEA__server__START_SSH_SERVER=true
volumes:
- ./data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
expose:
- "3000" # 仅内部网络暴露,不对外映射
ports:
- "222:22" # SSH 端口
networks:
- gitea_network