-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.tcp.yml
More file actions
48 lines (46 loc) · 1.43 KB
/
docker-compose.tcp.yml
File metadata and controls
48 lines (46 loc) · 1.43 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
# Minimal compose for the TCP proxy with optional BPF sockmap zero-copy
# relay. Uses host networking so sockmap can attach to real kernel
# sockets and SO_REUSEPORT shards across workers on the host's real
# NIC / loopback stack.
#
# Usage:
#
# # Fixed backend, userspace relay:
# TCP_BACKEND_ENDPOINT=10.0.0.2:5432 \
# docker compose -f docker-compose.tcp.yml up --build
#
# # With sockmap zero-copy:
# TCP_SOCKMAP_ENABLED=1 \
# TCP_BACKEND_ENDPOINT=10.0.0.2:5432 \
# docker compose -f docker-compose.tcp.yml up --build
#
# # Custom resolver:
# docker compose -f docker-compose.tcp.yml \
# run -v ./resolver.php:/etc/utopia-proxy/resolver.php:ro tcp-proxy
services:
tcp-proxy:
build:
context: .
dockerfile: Dockerfile
container_name: utopia-tcp-proxy
network_mode: host
cap_add:
- BPF
- NET_ADMIN
- SYS_RESOURCE
- IPC_LOCK
ulimits:
nofile:
soft: 1048576
hard: 1048576
memlock: -1
environment:
TCP_BACKEND_ENDPOINT: "${TCP_BACKEND_ENDPOINT:-127.0.0.1:15432}"
TCP_POSTGRES_PORT: "${TCP_POSTGRES_PORT:-25432}"
TCP_MYSQL_PORT: "${TCP_MYSQL_PORT:-0}"
TCP_WORKERS: "${TCP_WORKERS:-8}"
TCP_REACTOR_NUM: "${TCP_REACTOR_NUM:-8}"
TCP_SKIP_VALIDATION: "${TCP_SKIP_VALIDATION:-1}"
TCP_SOCKMAP_ENABLED: "${TCP_SOCKMAP_ENABLED:-0}"
TCP_SOCKMAP_BPF_OBJECT: "/opt/proxy/relay.bpf.o"
restart: unless-stopped