worktree clean

This commit is contained in:
whaffman 2025-05-20 11:55:54 -04:00
parent 51ebedd83a
commit 4bf28f2e28
5 changed files with 52 additions and 40 deletions

View File

@ -5,7 +5,7 @@ MYSQL_USER=wordpress
MYSQL_PASSWORD=42wordpress42
MYSQL_ROOT_PASSWORD=42root42
DB_HOST=localhost
DB_HOST=mariadb
DB_PORT=3306
WP_TITLE=Inception

View File

@ -2,6 +2,7 @@ version: '3.8'
services:
mariadb:
container_name: mariadb
restart: always
build:
context: ./requirements/mariadb
@ -26,19 +27,19 @@ services:
# volumes:
# - data_wordpress:/var/www/html
wordpress:
restart: always
build:
context: ./requirements/wordpress
dockerfile: Dockerfile
depends_on:
- mariadb
ports:
- '9000:9000'
networks:
- docker-network
volumes:
- data_wordpress:/var/www/html
# wordpress:
# restart: always
# build:
# context: ./requirements/wordpress
# dockerfile: Dockerfile
# depends_on:
# - mariadb
# ports:
# - '9000:9000'
# networks:
# - docker-network
# volumes:
# - data_wordpress:/var/www/html
networks:

View File

@ -28,22 +28,22 @@ RUN mkdir -p /var/run/mysqld && \
COPY ./tools/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
COPY ./conf/my.cnf /etc/my.cnf
# COPY ./init.sql /usr/local/bin/init.sql
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Expose the MySQL port
EXPOSE 3306
# Set the user and group to run the container
USER mariadb:mariadb
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Set the working directory
WORKDIR /var/lib/mysql
# Set the entrypoint script to be executed when the container starts
# The entrypoint script will initialize the database and start the server
USER mariadb
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# Start the MariaDB server
CMD ["mysqld"]
CMD ["mysqld", "--datadir=/var/lib/mysql", "--user=mariadb"]

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e
# If the first argument is 'mysqld', then start MariaDB

View File

@ -1,31 +1,42 @@
FROM:alpine:3.20
FROM alpine:3.20
# Install WordPress and its dependencies
# The --no-cache option is used to prevent the package manager from caching the downloaded packages
# rm -rf /var/cache/apk/* is used to remove any cached files after installation
# This helps to keep the image size small
RUN apk add --no-cache \
php83 \
php83-phar \
php83-fpm \
php83-mysqli \
php83-mbstring \
php83-json \
php83-curl \
php83-xml \
php83-zip \
php83-gd \
php83-session \
mariadb-client \
rm -rf /var/cache/apk/*
php83-mysqli \
php83-mbstring \
php83-json \
php83-curl \
php83-xml \
php83-zip \
php83-gd \
php83-session \
mariadb-client \
curl \
rm -rf /var/cache/apk/*
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && \
mv wp-cli.phar /usr/local/bin/wp
# Add a new user and group
RUN adduser -D -g 'wordpress' wordpress
# Set ownership of the working directory
RUN mkdir -p /var/www/html && \
chown -R www-data:www-data /var/www/html
chown -R wordpress:wordpress /var/www/html
# Install WP-CLI
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && \
mv wp-cli.phar /usr/local/bin/wp
# Copy the entrypoint script and configuration files
# and set the necessary permissions
# The entrypoint script will be responsible for initializing the database
COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN echo "memory_limit = 512M" >> /etc/php83/php.ini
# Copy and set permissions for the install script
COPY ./tools/install.sh /usr/local/bin/install.sh
RUN chmod +x /usr/local/bin/install.sh
RUN /usr/local/bin/install.sh
# Switch to the new user
USER wordpress
CMD ["php-fpm83", "-F"]