Skip to content

Instantly share code, notes, and snippets.

@jclem
Last active January 28, 2019 21:25
Show Gist options
  • Save jclem/4dc30659f27112a51f8f436af9ddf1d1 to your computer and use it in GitHub Desktop.
Save jclem/4dc30659f27112a51f8f436af9ddf1d1 to your computer and use it in GitHub Desktop.
Using a database in GitHub Actions
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"]
#!/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 "$*"
[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