增加线上配置 caddy+gitea
This commit is contained in:
60
docker-compose.yml
Normal file
60
docker-compose.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
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
|
||||
Reference in New Issue
Block a user