forked from akash-network/awesome-akash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yaml
123 lines (106 loc) · 2.67 KB
/
deploy.yaml
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
---
version: "2.0"
services:
ipfs:
image: ipfs/kubo:v0.30.0
expose:
- port: 5001
as: 5001
to:
- service: nginx
- port: 8080
as: 8080
to:
- service: nginx
env:
- IPFS_EXTERNAL_ADDR= #Fill in the ingress URL assigned by the provider
- IPFS_LOGGING=info
command:
- sh
- -c
args:
- >
#/usr/local/bin/start_ipfs config --json Addresses.API '"/ip4/0.0.0.0/tcp/80"'
if [ -n "${IPFS_EXTERNAL_ADDR}" ]; then
/usr/local/bin/start_ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["'${IPFS_EXTERNAL_ADDR}'", "http://ipfs:5001"]'
/usr/local/bin/start_ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST", "OPTIONS"]'
fi
exec /sbin/tini -- /usr/local/bin/start_ipfs daemon --migrate=true --agent-version-suffix=docker
nginx:
image: nginx:1.27
expose:
- port: 80
as: 80
to:
- global: true
env:
- BASIC_AUTH_USER=ipfs
- BASIC_AUTH_PASS=secretpass
command:
- sh
- -c
args:
- >
touch /etc/nginx/.htpasswd
if [ -n "${BASIC_AUTH_PASS}" ]; then
apt-get update &&\
apt-get install -y apache2-utils &&\
htpasswd -c -b /etc/nginx/.htpasswd $BASIC_AUTH_USER $BASIC_AUTH_PASS
fi
NGINX_CONFIG='
server {
listen 80 default_server;
client_max_body_size 100M;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
location / {
auth_basic "Restricted";
auth_basic_user_file .htpasswd;
proxy_http_version 1.1;
proxy_pass http://ipfs:5001/;
}
location /ipfs/ {
proxy_http_version 1.1;
proxy_pass http://ipfs:8080/ipfs/;
}
}
'
echo ${NGINX_CONFIG} > /etc/nginx/conf.d/ipfs.conf
nginx -g "daemon off;"
profiles:
compute:
ipfs:
resources:
cpu:
units: 2.0
memory:
size: 4Gi
storage:
size: 1Gi
nginx:
resources:
cpu:
units: 1
memory:
size: 1Gi
storage:
size: 200Mi
placement:
akash:
pricing:
ipfs:
denom: uakt
amount: 10000
nginx:
denom: uakt
amount: 10000
deployment:
ipfs:
akash:
profile: ipfs
count: 1
nginx:
akash:
profile: nginx
count: 1