File tree Expand file tree Collapse file tree 3 files changed +35
-12
lines changed Expand file tree Collapse file tree 3 files changed +35
-12
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ COPY hosting/single/redis.conf /etc/redis/redis.conf
83
83
WORKDIR /
84
84
COPY hosting/single/runner.sh .
85
85
RUN chmod +x ./runner.sh
86
+ COPY hosting/single/redis-runner.sh .
87
+ RUN chmod +x ./redis-runner.sh
86
88
COPY hosting/single/healthcheck.sh .
87
89
RUN chmod +x ./healthcheck.sh
88
90
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ REDIS_CONFIG=" /etc/redis/redis.conf"
4
+ sed -i " s#DATA_DIR#${DATA_DIR} #g" " ${REDIS_CONFIG} "
5
+
6
+ if [[ -n " ${USE_DEFAULT_REDIS_CONFIG} " ]]; then
7
+ unset REDIS_CONFIG
8
+ fi
9
+
10
+ REDIS_LAUNCH_SCRIPT=" /tmp/redis-server-launch.sh"
11
+ cat << EOF > "$REDIS_LAUNCH_SCRIPT "
12
+ #!/bin/bash
13
+ if [[ -n "\$ {REDIS_PASSWORD}" ]]; then
14
+ if [[ -n "\$ {REDIS_CONFIG}" ]]; then
15
+ exec redis-server "\$ {REDIS_CONFIG}" --requirepass "\$ REDIS_PASSWORD"
16
+ else
17
+ exec redis-server --requirepass "\$ REDIS_PASSWORD"
18
+ fi
19
+ else
20
+ if [[ -n "\$ {REDIS_CONFIG}" ]]; then
21
+ exec redis-server "\$ {REDIS_CONFIG}"
22
+ else
23
+ exec redis-server
24
+ fi
25
+ fi
26
+ EOF
27
+
28
+ chmod +x " $REDIS_LAUNCH_SCRIPT "
29
+
30
+ echo " Starting redis-server with pm2..."
31
+ pm2 start " $REDIS_LAUNCH_SCRIPT " --name redis-server --interpreter bash
Original file line number Diff line number Diff line change @@ -88,18 +88,8 @@ mkdir -p ${DATA_DIR}/redis
88
88
mkdir -p ${DATA_DIR} /couch
89
89
chown -R couchdb:couchdb ${DATA_DIR} /couch
90
90
91
- REDIS_CONFIG=" /etc/redis/redis.conf"
92
- sed -i " s#DATA_DIR#${DATA_DIR} #g" " ${REDIS_CONFIG} "
93
-
94
- if [[ -n " ${USE_DEFAULT_REDIS_CONFIG} " ]]; then
95
- REDIS_CONFIG=" "
96
- fi
97
-
98
- if [[ -n " ${REDIS_PASSWORD} " ]]; then
99
- redis-server " ${REDIS_CONFIG} " --requirepass $REDIS_PASSWORD > /dev/stdout 2>&1 &
100
- else
101
- redis-server " ${REDIS_CONFIG} " > /dev/stdout 2>&1 &
102
- fi
91
+ echo " Starting Redis runner..."
92
+ ./redis-runner.sh &
103
93
104
94
echo " Starting callback CouchDB runner..."
105
95
./bbcouch-runner.sh &
You can’t perform that action at this time.
0 commit comments