Inception/srcs/requirements/redis/Dockerfile
2025-05-22 12:31:42 +02:00

26 lines
482 B
Docker

FROM alpine:3.20
# Install Redis and its dependencies
RUN apk add --no-cache \
redis && \
rm -rf /var/cache/apk/*
ARG HOST_UID
# Expose the default Redis port
EXPOSE 6379
# Set the working directory
WORKDIR /data
# Set Redis to run as a non-root user (optional)
ARG HOST_UID
RUN addgroup -S -g $HOST_UID redis && \
adduser -S -u $HOST_UID redis -G redis && \
chown -R redis:redis /data
USER redis
# Start Redis server
CMD ["redis-server", "--protected-mode", "no"]