Skip to content

Commit 31186e3

Browse files
authored
Merge pull request #70 from mounta11n/add-ztnet
add ztnet stack
2 parents 3ee94e2 + be8d139 commit 31186e3

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed
+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
volumes:
3+
zerotier:
4+
postgres-data:
5+
caddy_data:
6+
7+
networks:
8+
app-network:
9+
driver: bridge
10+
ipam:
11+
driver: default
12+
config:
13+
- subnet: 172.31.255.0/29
14+
15+
services:
16+
postgres:
17+
image: postgres:15.2-alpine
18+
container_name: postgres
19+
restart: unless-stopped
20+
environment:
21+
POSTGRES_USER: postgres
22+
POSTGRES_PASSWORD: postgres
23+
POSTGRES_DB: ztnet
24+
volumes:
25+
- postgres-data:/var/lib/postgresql/data
26+
networks:
27+
- app-network
28+
29+
zerotier:
30+
image: zyclonite/zerotier:1.14.0
31+
hostname: zerotier
32+
container_name: zerotier
33+
restart: unless-stopped
34+
volumes:
35+
- zerotier:/var/lib/zerotier-one
36+
cap_add:
37+
- NET_ADMIN
38+
- SYS_ADMIN
39+
devices:
40+
- /dev/net/tun:/dev/net/tun
41+
networks:
42+
- app-network
43+
ports:
44+
- "9993:9993/udp"
45+
environment:
46+
- ZT_OVERRIDE_LOCAL_CONF=true
47+
- ZT_ALLOW_MANAGEMENT_FROM=172.31.255.0/29
48+
49+
ztnet:
50+
image: sinamics/ztnet:latest
51+
container_name: ztnet
52+
working_dir: /app
53+
volumes:
54+
- zerotier:/var/lib/zerotier-one
55+
restart: unless-stopped
56+
ports:
57+
- 127.0.0.1:3000:3000
58+
environment:
59+
POSTGRES_HOST: postgres
60+
POSTGRES_PORT: 5432
61+
POSTGRES_USER: postgres
62+
POSTGRES_PASSWORD: postgres
63+
POSTGRES_DB: ztnet
64+
NEXTAUTH_URL: "http://your-url-or-ip:3000"
65+
NEXTAUTH_SECRET: "random_secret"
66+
NEXTAUTH_URL_INTERNAL: "http://ztnet:3000" # Internal NextAuth URL for 'ztnet' container on port 3000. Do not change unless modifying container name.
67+
networks:
68+
- app-network
69+
links:
70+
- postgres
71+
depends_on:
72+
- postgres
73+
- zerotier
74+
75+
https-proxy:
76+
image: caddy:latest
77+
container_name: ztnet-https-proxy
78+
restart: unless-stopped
79+
depends_on:
80+
- ztnet
81+
command: caddy reverse-proxy --from <YOUR-PUBLIC-HOST-NAME> --to ztnet:3000
82+
volumes:
83+
- caddy_data:/data
84+
networks:
85+
- app-network
86+
links:
87+
- ztnet
88+
ports:
89+
- "80:80"
90+
- "443:443"

0 commit comments

Comments
 (0)