-
Notifications
You must be signed in to change notification settings - Fork 236
/
Copy pathdeploy.yml
81 lines (76 loc) · 2.05 KB
/
deploy.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
---
version: "2.0"
services:
nginx-ssl:
image: nginx:1.27
expose:
- port: 80
as: 80
to:
- global: true
ip: myendpointa
- port: 443
as: 443
to:
- global: true
ip: myendpointa
env:
- "DOMAIN=YOURDOMAIN.COM" # Change this to your domain
- "NGINX_CONF_URL=" # Set this to the URL of your NGINX config see example /nginx-letsencrypt-proxy/nginx.conf
- "FIRST_START=true" # Set this to false after you have set the A Record in your DNS
command:
- "bash"
- "-c"
args:
- >-
if [ -f /etc/nginx-persistent/nginx.conf ]; then
echo "nginx.conf already exists";
else
echo "Get NGINX config from $NGINX_CONF_URL";
wget $NGINX_CONF_URL -O /etc/nginx-persistent/nginx.conf;
fi
while [ "$FIRST_START" = true ]; do
echo "Please set the A Record in your DNS to your leased IP and update the SDL with FIRST_START=false";
sleep 20;
done
cp /etc/nginx-persistent/nginx.conf /etc/nginx/nginx.conf;
apt-get update;
apt-get upgrade -y;
apt install -y certbot python3-certbot-nginx wget;
certbot --nginx -d $DOMAIN --non-interactive --agree-tos --register-unsafely-without-email;
service nginx stop;
nginx -g "daemon off;"
params:
storage:
data:
mount: /etc/nginx-persistent
readOnly: false
profiles:
compute:
nginx-ssl:
resources:
cpu:
units: 1
memory:
size: 4Gi
storage:
- size: 5Gi
- name: data
size: 1Gi
attributes:
persistent: true
class: beta3
placement:
dcloud:
pricing:
nginx-ssl:
denom: uakt
amount: 1000
deployment:
nginx-ssl:
dcloud:
profile: nginx-ssl
count: 1
endpoints:
myendpointa:
kind: ip