initial commit

This commit is contained in:
Hampus Kraft
2026-01-01 20:42:59 +00:00
commit 2f557eda8c
9029 changed files with 1490197 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
services:
valkey:
image: valkey/valkey:8-alpine
hostname: valkey
env_file:
- /etc/fluxer/valkey.env
entrypoint: /entrypoint.sh
volumes:
- valkey_data:/data
- ./conf/valkey.conf.template:/etc/valkey/valkey.conf.template:ro
- ./entrypoint.sh:/entrypoint.sh:ro
networks:
- fluxer-shared
ports:
- '6379:6379'
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
healthcheck:
test: ['CMD', 'valkey-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
fluxer-shared:
external: true
volumes:
valkey_data:
driver: local

View File

@@ -0,0 +1,69 @@
bind 0.0.0.0
port 6379
protected-mode yes
requirepass ${VALKEY_PASSWORD}
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize no
pidfile /var/run/valkey.pid
loglevel notice
logfile ""
databases 16
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
dir /data
maxmemory 3gb
maxmemory-policy allkeys-lru
appendonly yes
appendfilename "appendonly.aof"
appenddirname "appendonlydir"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 100
notify-keyspace-events ""
hash-max-listpack-entries 512
hash-max-listpack-value 64
list-max-listpack-size -2
list-compress-depth 0
set-max-intset-entries 512
set-max-listpack-entries 128
set-max-listpack-value 64
zset-max-listpack-entries 128
zset-max-listpack-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes

View File

@@ -0,0 +1,27 @@
#!/bin/sh
# Copyright (C) 2026 Fluxer Contributors
#
# This file is part of Fluxer.
#
# Fluxer is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Fluxer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
set -e
# Substitute environment variables in the config file
sed -e "s|\${VALKEY_PASSWORD}|${VALKEY_PASSWORD}|g" \
/etc/valkey/valkey.conf.template > /tmp/valkey.conf
# Start Valkey with the processed config
exec valkey-server /tmp/valkey.conf "$@"