File size: 955 Bytes
86301bd
 
cb8a063
86301bd
cb8a063
 
 
 
 
86301bd
cb8a063
 
 
 
 
 
 
 
71f9d01
cb8a063
 
 
 
 
 
71f9d01
cb8a063
 
 
 
 
 
 
 
 
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
#!/bin/sh

set -e

echo "====================== Writing rclone config ========================"
if [ -n "$RCLONE_CONF" ]; then
    mkdir -p ~/.config/rclone
    echo "$RCLONE_CONF" > ~/.config/rclone/rclone.conf
fi

echo "====================== Starting dufs (port 5000) ========================"
mkdir -p /data/files
/usr/local/bin/dufs /data/files \
    --allow-upload \
    --allow-delete \
    --allow-search \
    --allow-archive \
    --enable-cors \
    --path-prefix /files \
    --port 5000 \
    --bind 127.0.0.1 &

sleep 1

echo "====================== Starting code-server (port 8443) ========================"
sudo -E -u coder code-server \
    --bind-addr 127.0.0.1:8443 &

sleep 2

echo "====================== Starting nginx (port 7860) ========================"
# Remove default nginx site configs
rm -f /etc/nginx/sites-enabled/default /etc/nginx/sites-enabled/* /etc/nginx/conf.d/default.conf 2>/dev/null || true

nginx -g "daemon off;"