docker: add redis instance

This commit is contained in:
Zankaria 2024-12-01 17:11:27 +01:00
parent 5ee20431e2
commit cbcd743649
3 changed files with 33 additions and 0 deletions

View file

@ -23,6 +23,7 @@ services:
volumes:
- ./local-instances/${INSTANCE:-0}/www:/var/www
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- redis-sock:/var/run/redis
#MySQL Service
db:
@ -36,3 +37,13 @@ services:
MYSQL_ROOT_PASSWORD: password
volumes:
- ./local-instances/${INSTANCE:-0}/mysql:/var/lib/mysql
redis:
build:
context: ./
dockerfile: ./docker/redis/Dockerfile
volumes:
- redis-sock:/var/run/redis
volumes:
redis-sock:

6
docker/redis/Dockerfile Normal file
View file

@ -0,0 +1,6 @@
FROM redis:7.4-alpine
RUN mkdir -p /var/run/redis && chmod 777 /var/run/redis
COPY ./docker/redis/redis.conf /etc/redis.conf
ENTRYPOINT [ "docker-entrypoint.sh", "/etc/redis.conf" ]

16
docker/redis/redis.conf Normal file
View file

@ -0,0 +1,16 @@
# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is specified Redis will not listen on a TCP socket.
#port 6379
port 0
# Unix socket.
#
# Specify the path for the Unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
unixsocket /var/run/redis/redis-server.sock
# Executig a socket is a no-op, and we need to share acces to other programs.
# Shared the connection only with programs in the redis group for security.
#unixsocketperm 700
unixsocketperm 666