Introduce Redis Dockerfile and installation script
This commit is contained in:
parent
0363e6b53f
commit
1959137a0b
15
redis.sh
Executable file
15
redis.sh
Executable 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
10
redis/Dockerfile
Normal 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"]
|
11
redis/lib/systemd/system/redis.service
Normal file
11
redis/lib/systemd/system/redis.service
Normal 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
1293
redis/srv/redis/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user