soiz1 commited on
Commit
1167d19
·
verified ·
1 Parent(s): 809380b

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +21 -0
entrypoint.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ if [ -z "${BACKEND_HOSTNAME}" ]; then
4
+ echo "BACKEND_HOSTNAME not set"
5
+ exit 1
6
+ fi
7
+
8
+ HTTP_MODE=${HTTP_MODE:-https}
9
+
10
+ sed -i "s@https://pipedapi.kavin.rocks@${HTTP_MODE}://pipedapi.kavin.rocks@g" /usr/share/nginx/html/assets/*
11
+ sed -i "s/pipedapi.kavin.rocks/${BACKEND_HOSTNAME}/g" /usr/share/nginx/html/assets/*
12
+
13
+ if [ -n "${HTTP_WORKERS}" ]; then
14
+ sed -i "s/worker_processes auto;/worker_processes ${HTTP_WORKERS};/g" /etc/nginx/nginx.conf
15
+ fi
16
+
17
+ if [ -n "${HTTP_PORT}" ]; then
18
+ sed -i "s/80;/${HTTP_PORT};/g" /etc/nginx/conf.d/default.conf
19
+ fi
20
+
21
+ nginx -g "daemon off;"