Add gitea and drone

This commit is contained in:
mr-vercetti 2022-11-19 20:50:04 +01:00
parent 5ed781ee0b
commit 3823fe7a85
4 changed files with 123 additions and 2 deletions

View File

@ -24,6 +24,10 @@ All services are deployed using Docker compose and are run as a non-root user.
* [Redis](https://github.com/docker-library/redis) - cache service
* [MariaDB](https://github.com/linuxserver/docker-mariadb) - database
### Software development
* [Gitea](https://github.com/go-gitea/gitea) - git web service
* [Drone](https://github.com/harness/drone) - ci/cd
### Other
* [Bitwarden](https://github.com/dani-garcia/vaultwarden) - the best password manager
* [Wireguard](https://github.com/linuxserver/docker-wireguard) - VPN server

View File

@ -37,3 +37,24 @@ DUPLICATI_UID=
DUPLICATI_GID=
BACKUP_SOURCE_DIR=
BACKUP_DIR=
# netdata
HOSTNAME=
# gitea
# you need to create "git" user and group
GITEA_UID=
GITEA_GID=
GITEA_MYSQL_ROOT_PASSWORD=
GITEA_MYSQL_DATABASE=
GITEA_MYSQL_USER=
GITEA_MYSQL_PASSWORD=
# drone
DRONE_GITEA_SERVER=https://git.domain.com
DRONE_SERVER_HOST=https://drone.domain.com
DRONE_RPC_SECRET=
# generate these in gitea
DRONE_GITEA_CLIENT_ID=
DRONE_GITEA_CLIENT_SECRET=
DRONE_USER_CREATE=username:<--USERNAME-->,machine:false,admin:true,token:${DRONE_RPC_SECRET}

View File

@ -0,0 +1,94 @@
services:
gitea-db:
image: mysql:8
container_name: gitea-db
networks:
- softdev
environment:
- MYSQL_ROOT_PASSWORD=${GITEA_MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${GITEA_MYSQL_USER}
- MYSQL_PASSWORD=${GITEA_MYSQL_PASSWORD}
- MYSQL_DATABASE=${GITEA_MYSQL_DATABASE}
volumes:
- ${APPS_DIR}/gitea-db:/var/lib/mysql
restart: unless-stopped
gitea:
image: gitea/gitea
container_name: gitea
networks:
- proxy
- softdev
environment:
- USER_UID=${GITEA_UID}
- USER_GID=${GITEA_GID}
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=gitea-db:3306
- GITEA__database__NAME=${GITEA_MYSQL_DATABASE}
- GITEA__database__USER=${GITEA_MYSQL_USER}
- GITEA__database__PASSWD=${GITEA_MYSQL_PASSWORD}
volumes:
- ${APPS_DIR}/gitea:/data
- /home/git/.ssh/:/data/git/.ssh
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000"
- "2222:22"
restart: unless-stopped
depends_on:
- gitea-db
drone:
image: drone/drone
container_name: drone
environment:
- DRONE_DATABASE_DRIVER=sqlite3
- DRONE_DATABASE_DATASOURCE=/data/database.sqlite
- DRONE_GITEA_SERVER=${DRONE_GITEA_SERVER}
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
- DRONE_SERVER_PROTO=https
- DRONE_SERVER_HOST=${DRONE_SERVER_HOST}
- DRONE_GITEA_CLIENT_ID=${DRONE_GITEA_CLIENT_ID}
- DRONE_GITEA_CLIENT_SECRET=${DRONE_GITEA_CLIENT_SECRET}
- DRONE_LOGS_DEBUG=true
- DRONE_USER_CREATE=${DRONE_USER_CREATE}
ports:
- "3001:80"
- "9001:9000"
networks:
- proxy
- softdev
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${APPS_DIR}/drone:/data
restart: unless-stopped
depends_on:
- gitea
drone-runner:
container_name: drone-runner
image: drone/drone-runner-docker
environment:
- DRONE_RPC_PROTO=http
- DRONE_RPC_HOST=drone
- DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
- DRONE_RUNNER_NAME=runner
- DRONE_RUNNER_CAPACITY=2
- DRONE_RUNNER_NETWORKS=softdev
ports:
- "3002:3000"
networks:
- softdev
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
depends_on:
- drone
networks:
proxy:
external:
name: proxy
softdev:
name: softdev

View File

@ -14,11 +14,13 @@ services:
- SUBDOMAINS=wildcard
- VALIDATION=dns
- DNSPLUGIN=cloudflare
- EXTRA_DOMAINS=${EXTRA_DOMAINS}
- PROPAGATION=30
volumes:
- ${APPS_DIR}/swag:/config
ports:
- 443:443
- 80:80
- "443:443"
- "80:80"
restart: unless-stopped
networks: