worktree clean
This commit is contained in:
parent
51ebedd83a
commit
4bf28f2e28
@ -5,7 +5,7 @@ MYSQL_USER=wordpress
|
|||||||
MYSQL_PASSWORD=42wordpress42
|
MYSQL_PASSWORD=42wordpress42
|
||||||
MYSQL_ROOT_PASSWORD=42root42
|
MYSQL_ROOT_PASSWORD=42root42
|
||||||
|
|
||||||
DB_HOST=localhost
|
DB_HOST=mariadb
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
|
|
||||||
WP_TITLE=Inception
|
WP_TITLE=Inception
|
||||||
|
|||||||
@ -2,6 +2,7 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
mariadb:
|
mariadb:
|
||||||
|
container_name: mariadb
|
||||||
restart: always
|
restart: always
|
||||||
build:
|
build:
|
||||||
context: ./requirements/mariadb
|
context: ./requirements/mariadb
|
||||||
@ -26,19 +27,19 @@ services:
|
|||||||
# volumes:
|
# volumes:
|
||||||
# - data_wordpress:/var/www/html
|
# - data_wordpress:/var/www/html
|
||||||
|
|
||||||
wordpress:
|
# wordpress:
|
||||||
restart: always
|
# restart: always
|
||||||
build:
|
# build:
|
||||||
context: ./requirements/wordpress
|
# context: ./requirements/wordpress
|
||||||
dockerfile: Dockerfile
|
# dockerfile: Dockerfile
|
||||||
depends_on:
|
# depends_on:
|
||||||
- mariadb
|
# - mariadb
|
||||||
ports:
|
# ports:
|
||||||
- '9000:9000'
|
# - '9000:9000'
|
||||||
networks:
|
# networks:
|
||||||
- docker-network
|
# - docker-network
|
||||||
volumes:
|
# volumes:
|
||||||
- data_wordpress:/var/www/html
|
# - data_wordpress:/var/www/html
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@ -28,22 +28,22 @@ RUN mkdir -p /var/run/mysqld && \
|
|||||||
COPY ./tools/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
COPY ./tools/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||||
COPY ./conf/my.cnf /etc/my.cnf
|
COPY ./conf/my.cnf /etc/my.cnf
|
||||||
# COPY ./init.sql /usr/local/bin/init.sql
|
# COPY ./init.sql /usr/local/bin/init.sql
|
||||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
||||||
|
|
||||||
# Expose the MySQL port
|
# Expose the MySQL port
|
||||||
EXPOSE 3306
|
EXPOSE 3306
|
||||||
|
|
||||||
# Set the user and group to run the container
|
# 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
|
# Set the working directory
|
||||||
WORKDIR /var/lib/mysql
|
WORKDIR /var/lib/mysql
|
||||||
|
|
||||||
# Set the entrypoint script to be executed when the container starts
|
# Set the entrypoint script to be executed when the container starts
|
||||||
# The entrypoint script will initialize the database and start the server
|
# The entrypoint script will initialize the database and start the server
|
||||||
|
USER mariadb
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
|
|
||||||
# Start the MariaDB server
|
# Start the MariaDB server
|
||||||
CMD ["mysqld"]
|
CMD ["mysqld", "--datadir=/var/lib/mysql", "--user=mariadb"]
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# If the first argument is 'mysqld', then start MariaDB
|
# If the first argument is 'mysqld', then start MariaDB
|
||||||
|
|||||||
@ -1,31 +1,42 @@
|
|||||||
FROM:alpine:3.20
|
FROM alpine:3.20
|
||||||
|
|
||||||
# Install WordPress and its dependencies
|
# 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 \
|
RUN apk add --no-cache \
|
||||||
|
php83 \
|
||||||
|
php83-phar \
|
||||||
php83-fpm \
|
php83-fpm \
|
||||||
php83-mysqli \
|
php83-mysqli \
|
||||||
php83-mbstring \
|
php83-mbstring \
|
||||||
php83-json \
|
php83-json \
|
||||||
php83-curl \
|
php83-curl \
|
||||||
php83-xml \
|
php83-xml \
|
||||||
php83-zip \
|
php83-zip \
|
||||||
php83-gd \
|
php83-gd \
|
||||||
php83-session \
|
php83-session \
|
||||||
mariadb-client \
|
mariadb-client \
|
||||||
rm -rf /var/cache/apk/*
|
curl \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
|
# Add a new user and group
|
||||||
chmod +x wp-cli.phar && \
|
RUN adduser -D -g 'wordpress' wordpress
|
||||||
mv wp-cli.phar /usr/local/bin/wp
|
|
||||||
|
|
||||||
|
# Set ownership of the working directory
|
||||||
RUN mkdir -p /var/www/html && \
|
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
|
RUN echo "memory_limit = 512M" >> /etc/php83/php.ini
|
||||||
# and set the necessary permissions
|
|
||||||
# The entrypoint script will be responsible for initializing the database
|
# Copy and set permissions for the install script
|
||||||
COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
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"]
|
||||||
Loading…
Reference in New Issue
Block a user