Introduce Redis Dockerfile and installation script

This commit is contained in:
Disassembler 2017-12-13 13:43:22 +01:00
parent 0363e6b53f
commit 1959137a0b
4 changed files with 1329 additions and 0 deletions

15
redis.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
SOURCE_DIR=$(realpath $(dirname "${0}"))/redis
# Build Docker container
docker build -t redis ${SOURCE_DIR}
# Configure Redis
mkdir -p /srv/redis
cp ${SOURCE_DIR}/srv/redis/redis.conf /srv/redis/redis.conf
# 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

10
redis/Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM alpine:3.7
MAINTAINER Disassembler <disassembler@dasm.cz>
RUN apk --no-cache add redis
VOLUME ["/var/lib/redis"]
EXPOSE 6379
USER redis
CMD ["redis-server", "/etc/redis.conf"]

View File

@ -0,0 +1,11 @@
[Unit]
Description=Redis Docker container
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/docker run --rm --tmpfs /tmp --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

1293
redis/srv/redis/redis.conf Normal file

File diff suppressed because it is too large Load Diff