Skip to content

Commit

Permalink
wait for directories creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael P. Ribeiro committed Jul 29, 2021
1 parent 9019065 commit 1e10257
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ ENV INTERVAL 15
ENV TTL 60
ENV PATHS /stores/

CMD /usr/local/bin/python -u /usr/local/bin/rocksdb-prometheus-exporter \
--port $PORT \
--interval $INTERVAL \
--ttl $TTL \
$PATHS
COPY entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh

while [ ! -d ${PATHS} ]; do
echo "Waiting for directories "$PATHS"..."
sleep 1;
done;

/usr/local/bin/python -u /usr/local/bin/rocksdb-prometheus-exporter \
--port $PORT \
--interval $INTERVAL \
--ttl $TTL \
$PATHS

0 comments on commit 1e10257

Please sign in to comment.