-
Notifications
You must be signed in to change notification settings - Fork 15
/
docker-compose.tunnel.yml
93 lines (86 loc) · 2.72 KB
/
docker-compose.tunnel.yml
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
---
services:
cloudflared-frontend:
image: "cloudflare/cloudflared:2023.8.2"
command: "tunnel --url http://localhost:3000 --metrics localhost:40000"
hostname: cloudflared-frontend
network_mode: host
# sidecar container for cloudflared health
cloudflared-frontend-health:
image: "alpine"
command: sh -c 'apk add curl && sleep infinity'
network_mode: host
depends_on:
cloudflared-frontend:
condition: service_started
healthcheck:
test: curl -f http://localhost:40000/ready
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
cloudflared-backend:
image: "cloudflare/cloudflared:2023.8.2"
command: "tunnel --url http://localhost:8080 --metrics localhost:50000"
hostname: cloudflared-backend
network_mode: host
# sidecar container for cloudflared health
cloudflared-backend-health:
image: "alpine"
command: sh -c 'apk add curl && sleep infinity'
network_mode: host
depends_on:
cloudflared-backend:
condition: service_started
healthcheck:
test: curl -f http://localhost:50000/ready
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
cloudflared-ipfs:
image: "cloudflare/cloudflared:2023.8.2"
command: "tunnel --url http://localhost:8888 --metrics localhost:60000"
hostname: cloudflared-ipfs
network_mode: host
# sidecar container for cloudflared health
cloudflared-ipfs-health:
image: "alpine"
command: sh -c 'apk add curl && sleep infinity'
network_mode: host
depends_on:
cloudflared-ipfs:
condition: service_started
healthcheck:
test: curl -f http://localhost:60000/ready
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
cloudflared_post_setup:
image: "alpine"
network_mode: host
command: >
sh -exc "
apk add --no-cache curl jq &&
echo FRONTEND_URL=https://$(curl -s localhost:40000/quicktunnel | jq -r '.hostname') > /opt/env &&
echo NEXT_PUBLIC_BACKEND_URL=https://$(curl -s localhost:50000/quicktunnel | jq -r '.hostname') >> /opt/env &&
echo NEXT_PUBLIC_IPFS_GATEWAY_ENDPOINT=https://$(curl -s localhost:60000/quicktunnel | jq -r '.hostname')/ipfs/ >> /opt/env &&
echo Tunnel setup done &&
touch /opt/done &&
sleep infinity"
volumes:
- ./docker/.env.tunnel:/opt/env
depends_on:
cloudflared-frontend-health:
condition: service_healthy
cloudflared-backend-health:
condition: service_healthy
cloudflared-ipfs-health:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "test -f /opt/done"]
interval: 10s
timeout: 10s
retries: 10
start_period: 10s