diff --git a/redis-commander/Dockerfile b/redis-commander/Dockerfile new file mode 100644 index 0000000..7eab12c --- /dev/null +++ b/redis-commander/Dockerfile @@ -0,0 +1,3 @@ +FROM rediscommander/redis-commander +COPY entrypoint.sh / +ENTRYPOINT ["/entrypoint.sh"] diff --git a/redis-commander/docker-compose.yml b/redis-commander/docker-compose.yml new file mode 100644 index 0000000..3510c7f --- /dev/null +++ b/redis-commander/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3" +services: + redis: + image: redis:alpine + app: + build: "." + ports: ["8081:8081"] + links: [redis] + environment: + - FLY_REDIS_CACHE_URL=redis://redis + - HTTP_USER + - HTTP_PASSWORD diff --git a/redis-commander/entrypoint.sh b/redis-commander/entrypoint.sh new file mode 100755 index 0000000..8197fc7 --- /dev/null +++ b/redis-commander/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +export PORT=${PORT:-8080} +REDIS_HOST=`node -p "new URL('${FLY_REDIS_CACHE_URL}').hostname"` +REDIS_PORT=`node -p "new URL('${FLY_REDIS_CACHE_URL}').port"` +REDIS_PASSWORD=`node -p "new URL('${FLY_REDIS_CACHE_URL}').password"` +export REDIS_HOST=${REDIS_HOST:-localhost} REDIS_PORT=${REDIS_PORT:-6379} REDIS_PASSWORD +/redis-commander/docker/entrypoint.sh "$@" diff --git a/redis-commander/fly.toml b/redis-commander/fly.toml new file mode 100644 index 0000000..14b0478 --- /dev/null +++ b/redis-commander/fly.toml @@ -0,0 +1,21 @@ +app = "redis-commander-example" + +[[services]] + internal_port = 8080 + protocol = "tcp" + + [services.concurrency] + hard_limit = 25 + soft_limit = 20 + + [[services.ports]] + handlers = ["http"] + port = "80" + + [[services.ports]] + handlers = ["tls", "http"] + port = "443" + + [[services.tcp_checks]] + interval = 10000 + timeout = 2000