Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cadd1af

Browse files
Merge pull request #20 from Mettmett/traefik-gitea
initial commit
2 parents a0c1653 + 10f7e1f commit cadd1af

File tree

9 files changed

+320
-0
lines changed

9 files changed

+320
-0
lines changed

‎traefik-gitea/.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
TRAEFIKVERSION=saintmarcelin
2+
3+
SQLROOTGITEA=rootpassw0rd
4+
SQLUSERGITEA=user
5+
SQLPASSWORDGITEA=userpassw0rd
6+
SQLDBGITEA=giteadb

‎traefik-gitea/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# docker-compose Traefik + Gitea
2+
3+
Gitea a simple self-hosted and ready-to-use git server with CI/CD. Simpler and lighter than GitLab, it's a must have in your homelab ! More information at [the official website](https://docs.gitea.com/).
4+
5+
## :factory: Requirements
6+
7+
* linux host (tested successfully on Ubuntu 20.04 && 22.04, Debian 10 & 11)
8+
* docker >= 23.x
9+
* docker compose (plugin) >= 2.17.x
10+
11+
## :rocket: How to use
12+
13+
Clone this repo where you want with this line :
14+
15+
```bash
16+
git clone https://github.com/Mettmett/docker-compose.git:traefik-gitea
17+
```
18+
19+
You need to edit the file `.env` at the source folder to modify the values of some vars.
20+
21+
After that when you're all set, press the red button to initiate :fire: !
22+
23+
```bash
24+
docker compose pull && docker compose up -d && docker compose logs -f
25+
```
26+
27+
## :star: Author
28+
29+
Made by Julien HOMMET :fr: for [my personnal website](https://j.hommet.net)
30+
31+
* Twitter: [@mettmettz](https://twitter.com/mettmettz)
32+
* GitHub: [Mettmett](https://github.com/Mettmett)
33+
34+
## :wrench: Support & Contribution
35+
36+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
37+
38+
## :moneybag: Licence
39+
40+
[CC BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/4.0)
41+
42+
## :anchor: Misc

‎traefik-gitea/conf/acme.json

Whitespace-only changes.

‎traefik-gitea/conf/traefik.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
global:
3+
sendAnonymousUsage: true
4+
checkNewVersion: false
5+
6+
api:
7+
#insecure: true
8+
dashboard: true
9+
#debug: true
10+
11+
log:
12+
filePath: "/etc/traefik/applog.log"
13+
format: json
14+
level: "ERROR"
15+
16+
providers:
17+
docker:
18+
#endpoint: unix:///var/run/docker.sock
19+
endpoint: tcp://dockerproxy:2375
20+
network: dockerproxynet
21+
exposedByDefault: false
22+
watch: true
23+
swarmMode: false
24+
file:
25+
directory: "/etc/traefik/dynamic"
26+
watch: true
27+
28+
entryPoints:
29+
web:
30+
address: ":80"
31+
http:
32+
redirections:
33+
entryPoint:
34+
to: websecure
35+
scheme: https
36+
websecure:
37+
address: ":443"
38+
metrics:
39+
address: ":9090"
40+
ping:
41+
address: ":8082"
42+
43+
ping:
44+
entryPoint: "ping"
45+
46+
certificatesResolvers:
47+
letsencrypt:
48+
acme:
49+
email: mail@domain.name
50+
# caServer: https://acme-staging-v02.api.letsencrypt.org/directory
51+
caServer: https://acme-v02.api.letsencrypt.org/directory
52+
storage: acme.json
53+
keyType: EC256
54+
httpChallenge:
55+
entryPoint: web
56+
57+
metrics:
58+
prometheus:
59+
entryPoint: metrics
60+
addEntryPointsLabels: true
61+
addRoutersLabels: true
62+
addServicesLabels: true
63+
buckets:
64+
- 0.1
65+
- 0.3
66+
- 1.2
67+
- 5.0
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
tls:
3+
options:
4+
default:
5+
minVersion: VersionTLS12
6+
sniStrict: true
7+
cipherSuites:
8+
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
9+
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
10+
- TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
11+
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
12+
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
13+
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
14+
- TLS_AES_128_GCM_SHA256
15+
- TLS_AES_256_GCM_SHA384
16+
- TLS_CHACHA20_POLY1305_SHA256
17+
curvePreferences:
18+
- CurveP521
19+
- CurveP384
20+
alpnProtocols:
21+
- h2
22+
- http/1.1
23+
mintls13:
24+
minVersion: VersionTLS13
25+
26+
http:
27+
middlewares:
28+
security:
29+
headers:
30+
accessControlAllowMethods:
31+
- GET
32+
- OPTIONS
33+
- PUT
34+
accessControlMaxAge: 100
35+
addVaryHeader: true
36+
browserXssFilter: true
37+
contentTypeNosniff: true
38+
forceSTSHeader: true
39+
frameDeny: true
40+
sslRedirect: true
41+
sslForceHost: true
42+
stsPreload: true
43+
customFrameOptionsValue: SAMEORIGIN
44+
referrerPolicy: "same-origin"
45+
featurePolicy: "camera 'none'; microphone 'none'; payment 'none'; usb 'none';"
46+
stsSeconds: 315360000
47+
hostsProxyHeaders:
48+
- "X-Forwarded-Host"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
http:
3+
routers:
4+
rt-traefik:
5+
entryPoints:
6+
- websecure
7+
service: api@internal
8+
rule: Host (`traefik.domain.name`)
9+
tls:
10+
options: default
11+
certResolver: letsencrypt
12+
13+
rt-gitea:
14+
entryPoints:
15+
- websecure
16+
middlewares:
17+
- security
18+
service: sc-gitea
19+
rule: Host (`git.domain.name`)
20+
tls:
21+
options: default
22+
certResolver: letsencrypt
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
http:
3+
services:
4+
sc-gitea:
5+
loadBalancer:
6+
servers:
7+
- url: "http://gitea:3000"

‎traefik-gitea/docker-compose.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
3+
services:
4+
dockerproxy:
5+
image: tecnativa/docker-socket-proxy:edge
6+
restart: always
7+
container_name: dockerproxy
8+
networks:
9+
- dockerproxynet
10+
volumes:
11+
- /var/run/docker.sock:/var/run/docker.sock:ro
12+
environment:
13+
LOG_LEVEL: info
14+
# 0 to revoke access / 1 to grant access.
15+
## Granted by Default
16+
EVENTS: 1
17+
PING: 1
18+
VERSION: 1
19+
## Revoked by Default
20+
# Security critical
21+
AUTH: 0
22+
SECRETS: 0
23+
# Not always needed
24+
BUILD: 0
25+
COMMIT: 0
26+
CONFIGS: 0
27+
CONTAINERS: 1 # Traefik, portainer, etc.
28+
DISTRIBUTION: 0
29+
EXEC: 0
30+
IMAGES: 1 # Portainer
31+
INFO: 1 # Portainer
32+
NETWORKS: 1 # Portainer
33+
NODES: 0
34+
PLUGINS: 0
35+
SERVICES: 1 # Portainer
36+
SESSION: 0
37+
SWARM: 0
38+
SYSTEM: 0
39+
TASKS: 1 # Portainer
40+
VOLUMES: 1 # Portainer
41+
TZ: "Europe/Paris"
42+
43+
traefik:
44+
image: traefik:${TRAEFIKVERSION}
45+
restart: unless-stopped
46+
container_name: traefik
47+
networks:
48+
- dockerproxynet
49+
ports:
50+
- target : 80
51+
published : 80
52+
protocol: tcp
53+
mode : host
54+
- target : 443
55+
published : 443
56+
protocol: tcp
57+
mode : host
58+
volumes:
59+
- ./conf/acme.json:/acme.json
60+
- ./conf/traefik.yml:/etc/traefik/traefik.yml:ro
61+
- ./conf/traefikdynamic:/etc/traefik/dynamic:ro
62+
- ./logs/traefik.log:/etc/traefik/applog.log
63+
- /etc/localtime:/etc/localtime:ro
64+
#- /var/run/docker.sock:/var/run/docker.sock:ro
65+
environment:
66+
TZ: "Europe/Paris"
67+
healthcheck:
68+
test: ["CMD", "traefik", "healthcheck", "--ping"]
69+
interval: 10s
70+
timeout: 5s
71+
retries: 3
72+
mem_limit: 256m
73+
mem_reservation: 128m
74+
depends_on:
75+
- dockerproxy
76+
77+
giteadb:
78+
image: mysql:8
79+
restart: unless-stopped
80+
container_name: giteadb
81+
environment:
82+
MYSQL_ROOT_PASSWORD: ${SQLROOTGITEA}
83+
MYSQL_USER: ${SQLUSERGITEA}
84+
MYSQL_PASSWORD: ${SQLPASSWORDGITEA}
85+
MYSQL_DATABASE: ${SQLDBGITEA}
86+
volumes:
87+
- ./giteaSqldata:/var/lib/mysql
88+
healthcheck:
89+
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
90+
timeout: 20s
91+
retries: 10
92+
93+
sqlexportergitea:
94+
image: prom/mysqld-exporter
95+
restart: unless-stopped
96+
container_name: sqlexportergitea
97+
environment:
98+
DATA_SOURCE_NAME: root:${SQLROOTGITEA}@(giteadb:3306)/${SQLDBGITEA}
99+
links:
100+
- giteadb
101+
depends_on:
102+
- giteadb
103+
mem_limit: 128m
104+
mem_reservation: 64m
105+
106+
gitea:
107+
image: gitea/gitea:1.19
108+
restart: unless-stopped
109+
container_name: gitea
110+
environment:
111+
GITEA__database__DB_TYPE: mysql
112+
GITEA__database__HOST: giteadb:3306
113+
GITEA__database__NAME: ${SQLDBGITEA}
114+
GITEA__database__USER: ${SQLUSERGITEA}
115+
GITEA__database__PASSWD: ${SQLPASSWORDGITEA}
116+
volumes:
117+
- ./gitea:/data
118+
- /etc/timezone:/etc/timezone:ro
119+
- /etc/localtime:/etc/localtime:ro
120+
depends_on:
121+
- giteadb
122+
123+
networks:
124+
dockerproxynet:
125+
name: dockerproxynet
126+
ipam:
127+
config:
128+
- subnet: 172.16.10.0/24

‎traefik-gitea/logs/traefik.log

Whitespace-only changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /