deploy redis to fly.io

This commit is contained in:
m5r 2021-10-23 23:43:26 +02:00
parent c9f8eab97f
commit 7860cbb90d
4 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,6 @@
FROM redis:alpine
ADD start-redis-server.sh /usr/bin/
RUN chmod +x /usr/bin/start-redis-server.sh
CMD ["start-redis-server.sh"]

View File

@ -0,0 +1,5 @@
app = "quirrel-redis-prod"
[[mounts]]
destination = "/data"
source = "redis_data"

View File

@ -0,0 +1,13 @@
# Redis
Redis instance running on fly.io
### How to
```shell
flyctl launch --name quirrel-redis-prod
node -e "console.log(crypto.randomBytes(16).toString('hex'))" # copy its output
flyctl secrets set REDIS_PASSWORD= # paste the 32-character long password copied previously
flyctl volumes create redis_data --region cdg
flyctl deploy
```

View File

@ -0,0 +1,4 @@
#!/bin/sh
sysctl vm.overcommit_memory=1
sysctl net.core.somaxconn=1024
redis-server --requirepass $REDIS_PASSWORD --dir /data/ --appendonly yes