Compare commits
3 Commits
5bc004a65a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 336ef286ac | |||
| fdc40a91e1 | |||
| 695371f600 |
17
.env
17
.env
@@ -2,8 +2,21 @@
|
|||||||
GITEA_UID=106
|
GITEA_UID=106
|
||||||
GITEA_GID=113
|
GITEA_GID=113
|
||||||
|
|
||||||
|
GITEA_NAME='MyGitRepo'
|
||||||
|
|
||||||
|
GITEA__server__DOMAIN='gitea.example.com'
|
||||||
|
GITEA__server__ROOT_URL='https://gitea.example.com'
|
||||||
|
|
||||||
|
GITEA__mailer__ENABLED='true'
|
||||||
|
GITEA__mailer__PROTOCOL='smtp'
|
||||||
|
GITEA__mailer__SMTP_ADDR='mail.example.com'
|
||||||
|
GITEA__mailer__SMTP_PORT='25'
|
||||||
|
GITEA__mailer__FROM='noreply@example.com'
|
||||||
|
GITEA__mailer__USER='user@example.com'
|
||||||
|
GITEA__mailer__PASSWD='secret'
|
||||||
|
|
||||||
|
|
||||||
# DB
|
# DB
|
||||||
POSTGRES_PASSWORD='Dn32ps$EmcGsw'
|
POSTGRES_PASSWORD='$$$changeMe$$$$'
|
||||||
POSTGRES_DB=gitea
|
POSTGRES_DB=gitea
|
||||||
POSTGRES_USER=gitea
|
POSTGRES_USER=gitea
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
3. Create directory for resistent data
|
3. Create directory for resistent data
|
||||||
4. edit .env and docker-compose.yml
|
4. edit .env and docker-compose.yml
|
||||||
|
|
||||||
|
|
||||||
Sources
|
Sources
|
||||||
|
|
||||||
[dev.to/](https://dev.to/ruanbekker/setup-a-self-hosted-git-service-with-gitea-11ce)
|
[dev.to/](https://dev.to/ruanbekker/setup-a-self-hosted-git-service-with-gitea-11ce)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
@@ -16,15 +16,29 @@ services:
|
|||||||
|
|
||||||
gitea:
|
gitea:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
# container_name: gitea
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
|
- APP_NAME=${GITEA_NAME}
|
||||||
- USER_UID=${GITEA_UID}
|
- USER_UID=${GITEA_UID}
|
||||||
- USER_GID=${GITEA_GID}
|
- USER_GID=${GITEA_GID}
|
||||||
|
- GITEA__server__ROOT_URL=${GITEA__server__ROOT_URL:?GITEA__server__ROOT_URL not set}
|
||||||
|
- GITEA__server__DOMAIN=${GITEA__server__DOMAIN:?GITEA__server__DOMAIN not set}
|
||||||
|
- GITEA__service__DISABLE_REGISTRATION=true
|
||||||
|
### IF Mailer is used you can activate self registration with email confirmation, mail notifies...
|
||||||
|
- GITEA__service__REGISTER_EMAIL_CONFIRM=true
|
||||||
|
- GITEA__service__ENABLE_NOTIFY_MAIL=true
|
||||||
- GITEA__database__DB_TYPE=postgres
|
- GITEA__database__DB_TYPE=postgres
|
||||||
- GITEA__database__HOST=db:5432
|
- GITEA__database__HOST=db:5432
|
||||||
- GITEA__database__NAME=${POSTGRES_DB}
|
- GITEA__database__NAME=${POSTGRES_DB}
|
||||||
- GITEA__database__USER=${POSTGRES_USER}
|
- GITEA__database__USER=${POSTGRES_USER}
|
||||||
- GITEA__database__PASSWD=${POSTGRES_PASSWORD}
|
- GITEA__database__PASSWD=${POSTGRES_PASSWORD}
|
||||||
|
- GITEA__mailer__ENABLED=${GITEA__mailer__ENABLED:?GITEA__mailer__ENABLED not set}
|
||||||
|
- GITEA__mailer__SMTP_ADDR=${GITEA__mailer__SMTP_ADDR:?GITEA__mailer__SMTP_ADDR not set}
|
||||||
|
- GITEA__mailer__SMTP_PORT=${GITEA__mailer__SMTP_PORT:?GITEA__mailer__SMTP_PORT not set}
|
||||||
|
- GITEA__mailer__PROTOCOL=${GITEA__mailer__PROTOCOL:?GITEA__mailer__PROTOCOL not set}
|
||||||
|
- GITEA__mailer__FROM=${GITEA__mailer__FROM:?GITEA__mailer__FROM not set}
|
||||||
|
# - GITEA__mailer__USER=${GITEA__mailer__USER:?GITEA__mailer__USER not set}
|
||||||
|
# - GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}"""
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
@@ -41,12 +55,17 @@ services:
|
|||||||
|
|
||||||
labels:
|
labels:
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
- traefik.http.routers.gitea.rule=Host(`gitea.cthsg.de`)
|
- traefik.http.routers.gitea.rule=Host(`gitea.example.com`)
|
||||||
- traefik.http.routers.gitea.tls.certResolver=le
|
- traefik.http.routers.gitea.tls.certResolver=le
|
||||||
- traefik.http.routers.gitea.service=gitea
|
- traefik.http.routers.gitea.service=gitea
|
||||||
- traefik.http.services.gitea.loadbalancer.server.port=3000
|
- traefik.http.services.gitea.loadbalancer.server.port=3000
|
||||||
- traefik.docker.network=proxy
|
- traefik.docker.network=proxy
|
||||||
|
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "1m"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
110
examples/all_in_one/docker-compose.yml
Normal file
110
examples/all_in_one/docker-compose.yml
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
# Source: https://containers.fan/posts/setup-gitea-on-docker-with-traefik/
|
||||||
|
|
||||||
|
---
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
gitea-traefik:
|
||||||
|
image: traefik:2.4
|
||||||
|
container_name: gitea-traefik
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./traefik/acme.json:/acme.json
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
networks:
|
||||||
|
- public
|
||||||
|
labels:
|
||||||
|
- 'traefik.enable=true'
|
||||||
|
- 'traefik.http.routers.api.rule=Host(`traefik.rbkr.xyz`)'
|
||||||
|
- 'traefik.http.routers.api.entrypoints=https'
|
||||||
|
- 'traefik.http.routers.api.service=api@internal'
|
||||||
|
- 'traefik.http.routers.api.tls=true'
|
||||||
|
- 'traefik.http.routers.api.tls.certresolver=letsencrypt'
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
- 443:443
|
||||||
|
command:
|
||||||
|
- '--api'
|
||||||
|
- '--providers.docker=true'
|
||||||
|
- '--providers.docker.exposedByDefault=false'
|
||||||
|
- '--entrypoints.http=true'
|
||||||
|
- '--entrypoints.http.address=:80'
|
||||||
|
- '--entrypoints.http.http.redirections.entrypoint.to=https'
|
||||||
|
- '--entrypoints.http.http.redirections.entrypoint.scheme=https'
|
||||||
|
- '--entrypoints.https=true'
|
||||||
|
- '--entrypoints.https.address=:443'
|
||||||
|
- '--certificatesResolvers.letsencrypt.acme.email=me@example.com'
|
||||||
|
- '--certificatesResolvers.letsencrypt.acme.storage=acme.json'
|
||||||
|
- '--certificatesResolvers.letsencrypt.acme.httpChallenge.entryPoint=http'
|
||||||
|
- '--log=true'
|
||||||
|
- '--log.level=INFO'
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "1m"
|
||||||
|
|
||||||
|
gitea:
|
||||||
|
container_name: gitea
|
||||||
|
image: gitea/gitea:${GITEA_VERSION:-1.14.5}
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
gitea-traefik:
|
||||||
|
condition: service_started
|
||||||
|
gitea-cache:
|
||||||
|
condition: service_healthy
|
||||||
|
environment:
|
||||||
|
- APP_NAME="Gitea"
|
||||||
|
- USER_UID=1000
|
||||||
|
- USER_GID=1000
|
||||||
|
- USER=git
|
||||||
|
- RUN_MODE=prod
|
||||||
|
- DOMAIN=git.rbkr.xyz
|
||||||
|
- SSH_DOMAIN=git.rbkr.xyz
|
||||||
|
- HTTP_PORT=3000
|
||||||
|
- ROOT_URL=https://git.rbkr.xyz
|
||||||
|
- SSH_PORT=222
|
||||||
|
- SSH_LISTEN_PORT=22
|
||||||
|
- DB_TYPE=sqlite3
|
||||||
|
- 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
|
||||||
|
ports:
|
||||||
|
- "222:22"
|
||||||
|
networks:
|
||||||
|
- public
|
||||||
|
volumes:
|
||||||
|
- ./data/gitea:/data
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.gitea.rule=Host(`git.rbkr.xyz`)"
|
||||||
|
- "traefik.http.routers.gitea.entrypoints=https"
|
||||||
|
- "traefik.http.routers.gitea.tls.certresolver=letsencrypt"
|
||||||
|
- "traefik.http.routers.gitea.service=gitea-service"
|
||||||
|
- "traefik.http.services.gitea-service.loadbalancer.server.port=3000"
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "1m"
|
||||||
|
|
||||||
|
gitea-cache:
|
||||||
|
container_name: gitea-cache
|
||||||
|
image: redis:6-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- public
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 15s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 30
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "1m"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
public:
|
||||||
|
name: public
|
||||||
Reference in New Issue
Block a user