Last active
January 28, 2019 21:25
-
-
Save jclem/4dc30659f27112a51f8f436af9ddf1d1 to your computer and use it in GitHub Desktop.
Using a database in GitHub Actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian | |
RUN apt-get update | |
RUN apt-get install -y supervisor | |
RUN apt-get install -y redis-server | |
RUN apt-get install -y netcat | |
COPY *.conf /etc/supervisor/conf.d/ | |
COPY entrypoint.sh /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
service supervisor start | |
# Wait for Redis | |
RETRIES=5 | |
until nc -z localhost 6379 || [ $RETRIES -eq 0 ]; do | |
echo "Waiting for Redis server, $((RETRIES--)) remaining attempts..." | |
sleep 1 | |
done | |
sh -c "$*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:redis] | |
command=redis-server | |
autostart=true | |
autorestart=true | |
stdout_logfile=/var/log/supervisor/redis.err.log | |
stderr_logfile=/var/log/supervisor/redis.out.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment