File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -81,4 +81,10 @@ RUN if [ "$ENV" = "dev" ]; then \
8181 apt-get clean && \
8282 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
8383 echo 'extension=tideways.so\n tideways.connection=tcp://tideways-daemon:9135\n tideways.enable_cli=0\n ' >> opt/docker/etc/php/php.ini; \
84- fi
84+ fi
85+
86+ # Copy custom supervisor's configs and scripts
87+ # Netcat is used to connect to a memcached server
88+ RUN apt-get update && apt-get install -y netcat
89+ COPY ./services/flush_cache.conf /opt/docker/etc/supervisor.d/
90+ COPY ./services/flush_cache.sh /opt/docker/bin/service.d/
Original file line number Diff line number Diff line change 1+ [group:flush_cache]
2+ programs=flush_cache
3+ priority=1
4+
5+ [program:flush_cache]
6+ command=/opt/docker/bin/service.d/flush_cache.sh
7+ process_name=%(program_name)s
8+ startsecs=0
9+ startretries=0
10+ autostart=true
11+ autorestart=false
12+ stdout_logfile=/dev/stdout
13+ stdout_logfile_maxbytes=0
14+ stderr_logfile=/dev/stderr
15+ stderr_logfile_maxbytes=0
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ MEMCACHED_SERVER_HOST=$( echo $MEMCACHED_SERVER | cut -d' :' -f 1)
3+ MEMCACHED_SERVER_PORT=$( echo $MEMCACHED_SERVER | cut -d' :' -f 2)
4+ echo flush_cache.sh: connecting to $MEMCACHED_SERVER
5+ echo flush_all | nc -q5 $MEMCACHED_SERVER_HOST $MEMCACHED_SERVER_PORT
6+ nc_exit_code=$?
7+ if [ $nc_exit_code != 0 ]; then
8+ echo flush_cache.sh: exit code $nc_exit_code
9+ else
10+ echo flush_cache.sh: connection was made and completed successfully
11+ fi
You can’t perform that action at this time.
0 commit comments