Added initial gitea config

pull/13/head
Jef Roosens 2021-04-23 16:32:54 +02:00
parent d13573f87d
commit 0a6ffbf67d
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
4 changed files with 111 additions and 7 deletions

16
gitea/.env.example 100644
View File

@ -0,0 +1,16 @@
# User to run container as
USER_UID=1000
USER_GID=1000
# Database settings
DB_TYPE=postgres
DB_HOST=db:5432
DB_NAME=gitea
DB_USER=gitea
DB_PASSWD=gitea
# Wether to start LFS
LFS_START_SERVER=true
# Wether to allow registration
DISABLE_REGISTRATION=true

View File

@ -0,0 +1,59 @@
version: '2.4'
services:
app:
# Latest contains a development version
image: 'gitea/gitea:1.14.1-rootless'
restart: 'always'
depends_on:
db:
condition: 'service_healthy'
healthcheck:
test: 'curl -f localhost:3000 || exit 1'
interval: '30s'
timeout: '5s'
retries: 3
start_period: '5s'
env_file:
- '.env'
networks:
- 'default'
- 'nginx'
ports:
- '22:22'
volumes:
- 'data:/data'
- 'repos:/data/git/repositories'
- 'lfs:/data/git/lfs'
- '/etc/timezone:/etc/timezone:ro'
- '/etc/localtime:/etc/localtime:ro'
db:
image: 'postgres:13.2-alpine'
restart: 'always'
healthcheck:
test: 'pg_isready -U gitea'
interval: '30s'
timeout: '5s'
retries: 3
start_period: '0s'
environment:
- 'POSTGRES_USER=gitea'
- 'POSTGRES_PASSWORD=gitea'
- 'POSTGRES_DB=gitea'
volumes:
- 'db-data:/var/lib/postgresql/data'
networks:
nginx:
external: true
volumes:
data:
lfs:
db-data:
repos:

View File

@ -51,3 +51,9 @@ NEXTCLOUD_HOST=nextcloud_app_1
PORTAINER_DOMAIN=
### Hostname
PORTAINER_HOST=portainer_app_1
## Gitea
### Domain name
GITEA_DOMAIN=
### Hostname
GITEA_HOST=gitea_app_1

View File

@ -0,0 +1,23 @@
server {
# SSL Key locations
ssl_certificate /etc/letsencrypt/live/${GITEA_DOMAIN}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/${GITEA_DOMAIN}/privkey.pem;
listen ${HTTPS_PORT} ssl;
listen [::]:${HTTPS_PORT} ssl;
server_name ${GITEA_DOMAIN};
location / {
resolver 127.0.0.11;
proxy_pass http://#{GITEA_HOST}:3000/;
# Static content caching
location ~* \.(?:jpg|jpeg|png|gif|ico|css|js|ttf)$ {
expires 1h;
add_header Cache-Control public;
proxy_pass http://${GITEA_HOST}:3000;
}
}
}