-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
192 lines (181 loc) · 4.41 KB
/
docker-compose.yml
File metadata and controls
192 lines (181 loc) · 4.41 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
services:
hub:
image: ircu2:latest
hostname: hub.undernet.org
build:
context: ircu2
dockerfile: ../Dockerfile.ircu2
ports:
- "4400:4400"
- "6669:6669"
volumes:
- ./etc/hub.conf:/ircd/etc/ircd.conf
- ./etc/hub.motd:/ircd/etc/motd
networks:
undernet:
ipv4_address: 10.5.0.10
leaf:
image: ircu2:latest
hostname: leaf.undernet.org
ports:
- "4401:4400"
- "6667:6667"
volumes:
- ./etc/leaf.conf:/ircd/etc/ircd.conf
- ./etc/leaf.motd:/ircd/etc/motd
depends_on:
- hub
networks:
undernet:
ipv4_address: 10.5.0.20
api:
#image: cservice-api:latest
hostname: api.undernet.org
build:
context: cservice-api
dockerfile_inline: |
# Stage 0: Extract CA certificates
FROM alpine:latest AS certs
RUN apk add --update --no-cache ca-certificates
# Stage 1: Build the Go binary
FROM golang:1.24.2-alpine AS builder
RUN apk add --no-cache git make bash
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 LDFLAGS="-s -w" make build
# Stage 2: Final minimal production image
FROM alpine:latest
RUN apk add --no-cache ca-certificates curl
COPY --from=builder /build/bin/cservice-api /cservice-api
EXPOSE 8080/tcp
ENTRYPOINT ["/cservice-api"]
environment:
- CSERVICE_DATABASE_HOST=db
- CSERVICE_REDIS_HOST=redis
- USER=nobody
ports:
- "8081:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/health-check"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
mail:
condition: service_started
networks:
undernet:
ipv4_address: 10.5.0.25
db:
image: postgres:17-alpine
hostname: db.undernet.org
restart: always
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./dbinit:/docker-entrypoint-initdb.d
- ./cservice-web:/cservice-web
- ./gnuworld:/gnuworld
environment:
- POSTGRES_DB=cservice
- POSTGRES_USER=cservice
- POSTGRES_PASSWORD=cservice
- POSTGRES_INITDB_ARGS="-E SQL_ASCII"
- LANG=C
healthcheck:
test: ["CMD-SHELL", "/docker-entrypoint-initdb.d/healthcheck.sh"]
interval: 5s
timeout: 5s
retries: 30
start_period: 10s
networks:
undernet:
ipv4_address: 10.5.0.30
redis:
image: valkey/valkey:7.2-alpine
hostname: redis.undernet.org
restart: always
ports:
- "6379:6379"
volumes:
- redisdata:/data
networks:
undernet:
ipv4_address: 10.5.0.35
mail:
image: axllent/mailpit
hostname: mail.undernet.org
ports:
- "1025:1025"
- "8025:8025"
networks:
undernet:
ipv4_address: 10.5.0.40
web:
build:
context: ./cservice-web
ports:
- "8080:80"
environment:
- PHP_SHORT_OPEN_TAG=On
- APACHE_ERRORLOG=/dev/stderr
- LOCALDB_USER=cservice
- LOCALDB_PASS=cservice
- LOCALDB_HOST=db.undernet.org
- REMOTEDB_NAME=cservice
- REMOTEDB_USER=cservice
- REMOTEDB_PASS=cservice
- REMOTEDB_HOST=db.undernet.org
- ENABLE_REGISTER_GLOBALS=1
- LOG_LEVEL=Logger::DEBUG
- LOG_STREAM_HANDLER=php://stdout
- SMTPHOST=mail.undernet.org:1025
volumes:
- ./cservice-web:/app
networks:
undernet:
ipv4_address: 10.5.0.50
depends_on:
db:
condition: service_healthy
mail:
condition: service_started
api:
condition: service_healthy
gnuworld:
image: gnuworld:latest
hostname: channels.undernet.org
#entrypoint: /bin/sh -c "while true; do sleep 1; done"
build:
context: .
dockerfile: Dockerfile.gnuworld
volumes:
- ./etc/gnuworld:/gnuworld/etc
networks:
undernet:
ipv4_address: 10.5.0.60
depends_on:
db:
condition: service_healthy
hub:
condition: service_started
api:
condition: service_healthy
volumes:
pgdata:
redisdata:
networks:
undernet:
driver: bridge
ipam:
config:
- subnet: 10.5.0.0/16
gateway: 10.5.0.1