Alpinize Redis
This commit is contained in:
parent
8733cb8b30
commit
5e398988d5
7
redis.sh
7
redis.sh
@ -10,7 +10,6 @@ cp ${SOURCE_DIR}/srv/redis/redis.conf /srv/redis/redis.conf
|
||||
chown -R 6379:6379 /srv/redis
|
||||
|
||||
# Configure Redis service
|
||||
cp ${SOURCE_DIR}/lib/systemd/system/redis.service /lib/systemd/system/redis.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable redis
|
||||
systemctl start redis
|
||||
cp ${SOURCE_DIR}/etc/init.d/redis /etc/init.d/redis
|
||||
rc-update add redis boot
|
||||
service redis start
|
||||
|
16
redis/etc/init.d/redis
Normal file
16
redis/etc/init.d/redis
Normal 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
|
||||
}
|
@ -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
|
Loading…
Reference in New Issue
Block a user