Skip to content

Commit 75e3545

Browse files
chore: add Docker Compose configuration for Tailscale and rabbit services
- Introduce a new docker-compose-tailscale.yml file to define services for rabbit and Tailscale. - Configure rabbit with migration support and fixed IP addresses within a custom network. - Set up Tailscale with necessary permissions and environment variables for secure networking.
1 parent 14f7be2 commit 75e3545

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: "3.9"
2+
3+
services:
4+
rabbit:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
restart: always
9+
ports:
10+
- "9999:9999"
11+
env_file:
12+
- ./.env
13+
depends_on:
14+
rabbit-migrate:
15+
condition: service_completed_successfully
16+
networks:
17+
rabbit-net:
18+
ipv4_address: 172.30.0.10 # fixed IP for rabbit inside bridge
19+
dokploy-network:
20+
21+
rabbit-migrate:
22+
build:
23+
context: .
24+
dockerfile: Dockerfile
25+
command: /usr/local/bin/rabbit.go database migrate /usr/local/bin/internal/database/migrations.sql
26+
env_file:
27+
- ./.env
28+
networks:
29+
rabbit-net:
30+
dokploy-network:
31+
32+
tailscale:
33+
image: tailscale/tailscale:latest
34+
container_name: tailscale-rabbit
35+
restart: always
36+
hostname: port.tcp.go # Tailscale node name
37+
cap_add:
38+
- NET_ADMIN
39+
devices:
40+
- /dev/net/tun:/dev/net/tun
41+
volumes:
42+
- ./ts-state:/var/lib/tailscale
43+
networks:
44+
rabbit-net:
45+
ipv4_address: 172.30.0.2 # TS router IP in this subnet
46+
environment:
47+
- TS_AUTHKEY=${TS_AUTHKEY}
48+
- TS_STATE_DIR=/var/lib/tailscale
49+
# advertise the docker bridge subnet to the tailnet
50+
- TS_EXTRA_ARGS=--hostname=port.tcp.go --advertise-routes=172.30.0.0/24
51+
52+
networks:
53+
rabbit-net:
54+
driver: bridge
55+
ipam:
56+
config:
57+
- subnet: 172.30.0.0/24
58+
dokploy-network:
59+
external: true

0 commit comments

Comments
 (0)