Alpinize Redis

This commit is contained in:
Disassembler 2017-12-19 19:12:51 +01:00
parent 8733cb8b30
commit 5e398988d5
3 changed files with 19 additions and 15 deletions

View File

@ -10,7 +10,6 @@ cp ${SOURCE_DIR}/srv/redis/redis.conf /srv/redis/redis.conf
chown -R 6379:6379 /srv/redis chown -R 6379:6379 /srv/redis
# Configure Redis service # Configure Redis service
cp ${SOURCE_DIR}/lib/systemd/system/redis.service /lib/systemd/system/redis.service cp ${SOURCE_DIR}/etc/init.d/redis /etc/init.d/redis
systemctl daemon-reload rc-update add redis boot
systemctl enable redis service redis start
systemctl start redis

16
redis/etc/init.d/redis Normal file
View File

@ -0,0 +1,16 @@
#!/sbin/openrc-run
description="Redis docker container"
depend() {
need docker net
use dns logger netmount
}
start() {
/usr/bin/docker run -d --rm --name redis -v /srv/redis/redis.conf:/etc/redis.conf -v /srv/redis/data:/var/lib/redis redis
}
stop() {
/usr/bin/docker stop redis
}

View File

@ -1,11 +0,0 @@
[Unit]
Description=Redis Docker container
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/docker run --rm --name redis -v /srv/redis/redis.conf:/etc/redis.conf -v /srv/redis/data:/var/lib/redis redis
ExecStop=/usr/bin/docker stop redis
[Install]
WantedBy=multi-user.target