46 lines
1.0 KiB
Docker
46 lines
1.0 KiB
Docker
FROM alpine:3.20
|
|
|
|
# Install WordPress and its dependencies
|
|
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 \
|
|
curl &&\
|
|
rm -rf /var/cache/apk/*
|
|
|
|
# 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 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 ./conf/www.conf /etc/php83/php-fpm.d/www.conf
|
|
|
|
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
|
|
|
|
|
|
# Switch to the new user
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/install.sh"]
|
|
|
|
CMD ["php-fpm83", "-F"] |