services stack
This commit is contained in:
parent
57d2c10e3b
commit
97b84cd791
1
services/.env.example
Normal file
1
services/.env.example
Normal file
@ -0,0 +1 @@
|
||||
GITEA_DB_PASSWORD=
|
||||
124
services/docker-compose.yml
Normal file
124
services/docker-compose.yml
Normal file
@ -0,0 +1,124 @@
|
||||
version: '3.8'
|
||||
|
||||
x-traefik-enable-labels: &traefik-labels
|
||||
traefik.enable: "true"
|
||||
traefik.swarm.network: "traefik"
|
||||
traefik.constraint-label: "traefik"
|
||||
|
||||
x-api-deploy: &api-deployment
|
||||
mode: replicated
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 5s
|
||||
order: start-first
|
||||
failure_action: rollback
|
||||
rollback_config:
|
||||
order: start-first
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
window: 120s
|
||||
|
||||
|
||||
services:
|
||||
gitea:
|
||||
image: docker.gitea.com/gitea:1.23.7
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- GITEA__database__DB_TYPE=mysql
|
||||
- GITEA__database__HOST=database:3306
|
||||
- GITEA__database__NAME=gitea
|
||||
- GITEA__database__USER=gitea
|
||||
- GITEA__database__PASSWD=${GITEA_DB_PASSWORD}
|
||||
- GITEA__server__ROOT_URL=https://gitea.szabolcsi.dev
|
||||
- GITEA__admin__DISABLE_REGULAR_ORG_CREATION=true
|
||||
- GITEA__service__DISABLE_REGISTRATION=true
|
||||
- GITEA__service__DEFAULT_USER_VISIBILITY=private
|
||||
- GITEA__service__DEFAULT_ORG_VISIBILITY=private
|
||||
- GITEA__session__PROVIDER=file
|
||||
networks:
|
||||
- local
|
||||
volumes:
|
||||
- gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "2222:22"
|
||||
deploy:
|
||||
replicas: 1
|
||||
<<: *api-deployment
|
||||
labels:
|
||||
<<: *traefik-labels
|
||||
traefik.http.routers.gitea.rule: "Host(`gitea.szabolcsi.dev`)"
|
||||
traefik.http.routers.gitea.entrypoints: "https"
|
||||
traefik.http.routers.gitea.tls: "true"
|
||||
traefik.http.routers.gitea.tls.certresolver: "letsencrypt"
|
||||
traefik.http.services.gitea.loadbalancer.server.port: "3000"
|
||||
traefik.http.services.gitea.loadbalancer.healthCheck.path: "/"
|
||||
traefik.http.services.gitea.loadbalancer.healthCheck.interval: "30s"
|
||||
traefik.http.services.gitea.loadbalancer.healthCheck.timeout: "1s"
|
||||
|
||||
|
||||
proxy:
|
||||
image: haproxy:3.1.7-alpine
|
||||
networks:
|
||||
local:
|
||||
aliases:
|
||||
- database
|
||||
database:
|
||||
aliases:
|
||||
- services-proxy
|
||||
configs:
|
||||
- source: haproxy
|
||||
target: /usr/local/etc/haproxy/haproxy.cfg
|
||||
deploy:
|
||||
replicas: 1
|
||||
<<: *api-deployment
|
||||
|
||||
|
||||
|
||||
networks:
|
||||
local:
|
||||
name: services
|
||||
driver: overlay
|
||||
internal: true
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.30.14.0/24
|
||||
traefik:
|
||||
external: true
|
||||
database:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
gitea:
|
||||
name: gitea-data
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: nfs
|
||||
device: ":/nfs_share/services/gitea"
|
||||
o: "addr=10.0.0.3,rw,soft,nfsvers=4"
|
||||
|
||||
configs:
|
||||
haproxy:
|
||||
name: haproxy-config
|
||||
content: |
|
||||
global
|
||||
log /dev/log local0
|
||||
log /dev/log local1 notice
|
||||
user root
|
||||
group root
|
||||
daemon
|
||||
defaults
|
||||
log global
|
||||
mode tcp
|
||||
option tcplog
|
||||
option dontlognull
|
||||
timeout connect 5000
|
||||
timeout client 50000
|
||||
timeout server 50000
|
||||
listen database
|
||||
bind *:3306
|
||||
server database database_mariadb:3306
|
||||
Loading…
x
Reference in New Issue
Block a user