Skip to content

Instantly share code, notes, and snippets.

@luojiyin1987
Last active March 15, 2020 14:08
Show Gist options
  • Save luojiyin1987/c3564925855790f9d402e743bb2861ba to your computer and use it in GitHub Desktop.
Save luojiyin1987/c3564925855790f9d402e743bb2861ba to your computer and use it in GitHub Desktop.
version: '3.6'
services:
gitea:
image: gitea/gitea:1.10.3
environment:
- USER_UID=1000
- USER_GID=1000
- APP_NAME=Private
- RUN_MODE=prod
- RUN_USER=git
- SSH_DOMAIN=git.luojiyin.top
- SSH_PORT=22
- SSH_LISTEN_PORT=22
# 如果不希望使用 SSH 协议
#- DISABLE_SSH=true
- HTTP_PORT=3000
- ROOT_URL=https://git.luojiyin.top
- LFS_START_SERVER=false
- DB_TYPE=sqlite3
- INSTALL_LOCK=false
- DISABLE_GRAVATAR=true
networks:
- traefik
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.giteaweb.middlewares=https-redirect@file"
- "traefik.http.routers.giteaweb.entrypoints=http"
- "traefik.http.routers.giteaweb.rule=Host(`git.luojiyin.top`)"
- "traefik.http.routers.giteassl.middlewares=content-compress@file"
- "traefik.http.routers.giteassl.entrypoints=https"
- "traefik.http.routers.giteassl.tls=true"
- "traefik.http.routers.giteassl.rule=Host(`git.luojiyin.top`)"
- "traefik.http.services.giteabackend.loadbalancer.server.scheme=http"
- "traefik.http.services.giteabackend.loadbalancer.server.port=3000"
- "traefik.tcp.routers.giteassh.rule=HostSNI(`*`)"
- "traefik.tcp.routers.giteassh.tls=true"
- "traefik.tcp.routers.giteassh.entrypoints=git"
- "traefik.tcp.routers.giteassh.service=gitea"
- "traefik.tcp.services.gitea.loadbalancer.server.port=22" volumes:
# 标准 Linux 系统下使用
# - /etc/localtime:/etc/localtime:ro
# - /etc/timezone:/etc/timezone:ro
- ./repositories:/data/git/repositories
- ./data:/data/gitea/
logging:
driver: "json-file"
options:
max-size: "10m"
extra_hosts:
- "git.luojiyin.top:127.0.0.1"
healthcheck:
test: ["CMD-SHELL", "wget -q --spider --proxy off localhost:3000 || exit 1"]
interval: 5s
networks:
traefik:
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment