From 81ea05b2484b88935dda9f9e96af20e8e3f39de6 Mon Sep 17 00:00:00 2001 From: marti Date: Thu, 8 Jan 2026 12:06:45 +0000 Subject: [PATCH] Afegit docker compose --- docker-compose.yml | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..582d27e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,64 @@ +services: + server: + image: gitea/gitea:latest + container_name: gitea-server + environment: + - USER_UID=1000 + - USER_GID=1000 + # -- Change your database settings here... + # --> PostgreSQL + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=${POSTGRES_HOST:-db}:${POSTGRES_PORT:-5432} + - GITEA__database__NAME=${POSTGRES_DB:?POSTGRES_DB not set} + - GITEA__database__USER=${POSTGRES_USER:?POSTGRES_USER not set} + - GITEA__database__PASSWD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD not set} + # <-- + # + # -- (Optional) Change your server settings here... + - GITEA__server__SSH_PORT=22 # <-- (Optional) Replace with your desired SSH port + - GITEA__server__ROOT_URL=https://gitea.martivich.es + # --> (Optional) When using traefik... + # networks: + # - frontend + # <-- + # --> (Optional) When using an internal database... + # - backend + # <-- + volumes: + - /home/marti/docker/gitea/data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + # --> (Optional) Remove when using traefik... + - "3000:3000" + # <-- + - "2221:22" # <-- (Optional) Replace with your desired SSH port + # --> (Optional) When using internal database... + depends_on: + - db + # <-- + # --> (Optional) When using traefik... + # labels: + # - traefik.enable=true + # - traefik.http.services.gitea.loadbalancer.server.port=3000 + # - traefik.http.services.gitea.loadbalancer.server.scheme=http + # - traefik.http.routers.gitea-https.entrypoints=websecure + # - traefik.http.routers.gitea-https.rule=Host(`your-fqdn`) # <-- Replace with your FQDN + # - traefik.http.routers.gitea-https.tls=true + # - traefik.http.routers.gitea-https.tls.certresolver=your-certresolver # <-- Replace with your certresolver + # <-- + restart: unless-stopped + + #--> When using internal database + db: + image: postgres:14 + container_name: gitea-db + environment: + - POSTGRES_USER=${POSTGRES_USER:?POSTGRES_USER not set} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD not set} + - POSTGRES_DB=${POSTGRES_DB:?POSTGRES_DB not set} + #networks: + # - backend + volumes: + - /home/marti/docker/gitea/db:/var/lib/postgresql/data + restart: unless-stopped