summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: c839302208a24b825cd77c4a43857c9fa5cb5f1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: "3"

services:
  caddy:
    image: caddy:2.6.2-alpine
    container_name: gateway
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - /var/volumes/configs/Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - /var/volumes/configs:/config
    networks:
      - gateway

  git:
    image: codeberg.org/forgejo/forgejo:1.19.3-0
    container_name: git
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - TZ=Europe/Moscow
      - USER=git
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=${PG_NAME}
      - GITEA__database__USER=${PG_USER}
      - GITEA__database__PASSWD=${PG_PASS}
    restart: always
    networks:
      - gitea
      - gateway
    volumes:
      - /home/git/.ssh/:/data/git/.ssh
      - /var/volumes/forge:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "127.0.0.1:2222:22"
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:13
    restart: always
    environment:
      - POSTGRES_USER=${PG_USER}
      - POSTGRES_PASSWORD=${PG_PASS}
      - POSTGRES_DB=${PG_NAME}
    healthcheck:
      test: /usr/bin/pg_isready
      interval: 5s
      timeout: 10s
      retries: 120
    networks:
      - gitea
    volumes:
      - /var/volumes/postgres:/var/lib/postgresql/data
      
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:latest
    volumes:
      - woodpecker-server-data:/var/lib/woodpecker/
    environment:
      - WOODPECKER_OPEN=true
      - WOODPECKER_GITEA=true
      - WOODPECKER_GITEA_URL=https://gitrepo.ru
      - WOODPECKER_GITEA_CLIENT=${GITEA_CLIENT}
      - WOODPECKER_GITEA_SECRET=${GITEA_SECRET}
      - WOODPECKER_HOST=https://ci.gitrepo.ru
      - WOODPECKER_ADMIN=neonxp
      - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
    networks:
      - gitea
      - gateway
    depends_on:
      - git

  woodpecker-agent:
    image: woodpeckerci/woodpecker-agent:latest
    command: agent
    restart: always
    depends_on:
      - woodpecker-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WOODPECKER_SERVER=woodpecker-server:9000
      - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
    networks:
      - gitea
      
volumes:
  woodpecker-server-data:
  caddy_data:
  caddy_config:
  forgejo:
  postgres:

networks:
    gateway:
    gitea:
        external: false