From f3306a51a79ec1b5d444b9487705731b6ad97891 Mon Sep 17 00:00:00 2001 From: leo <426742@gmail.com> Date: Thu, 8 Aug 2024 06:00:37 +0500 Subject: [PATCH] changes --- README.md | 10 +++++++++- docker-compose.yml | 47 +++++++++++++++++++++++----------------------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 3b058e4..14a1d87 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ +### Gitea +*docker configuration* -### Gitea \ No newline at end of file +Preparation: +`sudo bash /data/utils/init-db.sh gitea GITEA_DB_PASSWORD` + +Start: `sudo docker start gitea` +Start `sudo docker compose -f /data/gitea/docker-compose.yml up -d` + +Stop: `sudo docker stop gitea` \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 3218b61..8624555 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,30 +3,31 @@ services: image: gitea/gitea:1.22.0 container_name: gitea env_file: - - ./secrets/vars.env + - /data/secrets/${SERVER_DOMAIN}/${SERVER_DOMAIN}.env environment: - - APP_NAME="Gitea" - - USER_UID=1000 - - USER_GID=1000 - - USER=git - - RUN_MODE=prod - - DOMAIN=git.${DOMAIN} - - - SSH_DOMAIN=git.${DOMAIN} - - HTTP_PORT=3000 - - ROOT_URL=https://git.${DOMAIN} - - SSH_PORT=222 - - SSH_LISTEN_PORT=22 - - GITEA__cache__ENABLED=true - - GITEA__cache__ADAPTER=redis - - GITEA__cache__HOST=redis://gitea-cache:6379/0?pool_size=100&idle_timeout=180s - - GITEA__cache__ITEM_TTL=24h + APP_NAME: "Gitea" + USER_UID: 1000 + USER_GID: 1000 + USER: git + RUN_MODE: prod + DOMAIN: git.${SERVER_DOMAIN} + ROOT_URL: https://git.${SERVER_DOMAIN} + HTTP_PORT: 3000 + + SSH_PORT: 222 + SSH_LISTEN_PORT: 22 + SSH_DOMAIN: git.${SERVER_DOMAIN} + + GITEA__cache__ENABLED: true + GITEA__cache__ADAPTER: redis + GITEA__cache__HOST: redis://gitea-cache:6379/0?pool_size=100&idle_timeout=180s + GITEA__cache__ITEM_TTL: 24 + GITEA__database__DB_TYPE: postgres + GITEA__database__HOST: postgres:5432 + GITEA__database__NAME: gitea + GITEA__database__USER: gitea - - GITEA__database__DB_TYPE=postgres - - GITEA__database__HOST=postgres:5432 - - GITEA__database__NAME=gitea - - GITEA__database__USER=gitea - - GITEA__database__PASSWD=${GITEA_DB_PW} + GITEA__security__INSTALL_LOCK: true restart: always networks: - proxynet @@ -35,7 +36,7 @@ services: condition: service_started labels: - "traefik.enable=true" - - "traefik.http.routers.gitea.rule=Host(`git.${DOMAIN}`)" + - "traefik.http.routers.gitea.rule=Host(`git.${SERVER_DOMAIN}`)" - "traefik.http.routers.gitea.entrypoints=https" - "traefik.http.routers.gitea.service=gitea-service" - "traefik.http.services.gitea-service.loadbalancer.server.port=3000"