inital setup
This commit is contained in:
10
.drone.env.sample
Normal file
10
.drone.env.sample
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Drone settings
|
||||||
|
DRONETAG=
|
||||||
|
|
||||||
|
## https://docs.drone.io/server/provider/gitea/
|
||||||
|
DRONE_GITEA_SERVER=https://git.example.com
|
||||||
|
DRONE_GITEA_CLIENT_ID=
|
||||||
|
DRONE_GITEA_CLIENT_SECRET=
|
||||||
|
DRONE_RPC_SECRET=
|
||||||
|
DRONE_SERVER_HOST=ci.example.com
|
||||||
|
DRONE_SERVER_PROTO=https
|
||||||
1
.env.sample
Normal file
1
.env.sample
Normal file
@@ -0,0 +1 @@
|
|||||||
|
BASEDIR=
|
||||||
8
.git.env.sample
Normal file
8
.git.env.sample
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# gitea settings
|
||||||
|
GITTAG=
|
||||||
|
|
||||||
|
USER_UID=1000
|
||||||
|
USER_GID=1000
|
||||||
|
|
||||||
|
## preconfig for app.ini
|
||||||
|
## https://github.com/go-gitea/gitea/tree/main/contrib/environment-to-ini
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
files/
|
||||||
|
*.env
|
||||||
60
README.md
60
README.md
@@ -1,2 +1,60 @@
|
|||||||
# compose-gitea
|
# Basic git & drone docker-compose config
|
||||||
|
* can be run on single node setup or in swarm
|
||||||
|
|
||||||
|
## howto
|
||||||
|
### single node
|
||||||
|
#### start container
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
#### stop container (and remove)
|
||||||
|
```bash
|
||||||
|
docker compose down
|
||||||
|
```
|
||||||
|
|
||||||
|
#### view logs
|
||||||
|
```bash
|
||||||
|
docker compose logs -f
|
||||||
|
```
|
||||||
|
|
||||||
|
#### reload config
|
||||||
|
```bash
|
||||||
|
docker compose restart
|
||||||
|
```
|
||||||
|
|
||||||
|
### swarm
|
||||||
|
#### start aka deploy
|
||||||
|
hint: drone fails to start until git auth source is created and set in vars
|
||||||
|
```bash
|
||||||
|
docker stack deploy -c docker-compose.yml git
|
||||||
|
```
|
||||||
|
|
||||||
|
#### stop container aka service
|
||||||
|
```bash
|
||||||
|
docker service rm git_git
|
||||||
|
docker service rm git_drone
|
||||||
|
```
|
||||||
|
|
||||||
|
#### view logs
|
||||||
|
```bash
|
||||||
|
docker service logs git_git -f
|
||||||
|
docker service logs git_drone -f
|
||||||
|
```
|
||||||
|
|
||||||
|
#### reload config (no downtime if replica 2 or more)
|
||||||
|
```bash
|
||||||
|
docker service update git_git --force
|
||||||
|
docker service update git_drone --force
|
||||||
|
```
|
||||||
|
|
||||||
|
## example caddy config
|
||||||
|
```
|
||||||
|
git.example.com {
|
||||||
|
reverse_proxy git:80
|
||||||
|
}
|
||||||
|
|
||||||
|
ci.example.com {
|
||||||
|
reverse_proxy drone:80
|
||||||
|
}
|
||||||
|
```
|
||||||
53
docker-compose.yml
Normal file
53
docker-compose.yml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# https://docs.docker.com/compose/compose-file/compose-file-v3/
|
||||||
|
---
|
||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
git:
|
||||||
|
image: gitea/gitea:${GITTAG:-latest}
|
||||||
|
container_name: git
|
||||||
|
env_file:
|
||||||
|
- .git.env
|
||||||
|
- .env
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
placement:
|
||||||
|
max_replicas_per_node: 1
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
delay: 10s
|
||||||
|
volumes:
|
||||||
|
- ${BASEDIR:-.}/files/git/:/data/
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
drone:
|
||||||
|
image: drone/drone:${DRONETAG:-latest}
|
||||||
|
container_name: drone
|
||||||
|
env_file:
|
||||||
|
- .drone.env
|
||||||
|
- .env
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 8080:80
|
||||||
|
- 8443:443
|
||||||
|
deploy:
|
||||||
|
replicas: 1
|
||||||
|
placement:
|
||||||
|
max_replicas_per_node: 1
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
delay: 10s
|
||||||
|
volumes:
|
||||||
|
- ${BASEDIR:-.}/files/drone/:/data/
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
networks:
|
||||||
|
backend:
|
||||||
|
name: ${INTRANET:-backend}
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user