This commit is contained in:
whaffman 2025-05-22 12:30:01 +02:00
parent 401cdfb6c5
commit 4a61e55095
4 changed files with 40 additions and 2 deletions

View File

@ -71,6 +71,16 @@ services:
- data_wordpress:/var/www/html
restart: unless-stopped
redis:
container_name: redis
image: redis
build:
context: ./requirements/redis
dockerfile: Dockerfile
networks:
- docker-network
restart: unless-stopped
networks:
docker-network:

View File

@ -19,7 +19,8 @@ RUN addgroup -S -g $HOST_UID mariadb && \
# Create the necessary directories
RUN mkdir -p /var/run/mysqld && \
chown -R mariadb:mariadb /var/run/mysqld && \
chown -R mariadb:mariadb /var/lib/mysql
chown -R mariadb:mariadb /var/lib/mysql && \
chmod -R 750 /var/lib/mysql
# Copy the entrypoint script and configuration files
# and set the necessary permissions

View File

@ -10,7 +10,7 @@ if [ "$1" = 'mysqld' ]; then
echo "Database initialized."
# Start MariaDB temporarily to set up initial configuration
mysqld --user=mysql --skip-networking &
mysqld --user=mariadb --skip-networking &
pid="$!"
# Wait for MariaDB to start

View File

@ -0,0 +1,27 @@
FROM alpine:3.20
# Install Redis and its dependencies
RUN apk add --no-cache \
redis \
redis-tools && \
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"]