Skip to content

Commit

Permalink
slightly updated docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
ole1986 committed Nov 26, 2024
1 parent f489724 commit f1afadf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
18 changes: 6 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM php:8.2-apache

RUN apt update
RUN apt install -y default-mysql-client --no-install-recommends
RUN apt install -y libicu-dev less sudo nano msmtp-mta less sudo nano msmtp-mta
RUN apt install -y libicu-dev less sudo nano msmtp-mta

RUN docker-php-ext-install pdo pdo_mysql mysqli
RUN docker-php-ext-configure intl \
Expand All @@ -19,23 +19,17 @@ RUN apt install -y nodejs npm
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

RUN <<EOF cat >> /start.sh
/usr/local/bin/apache2-foreground &
apache2-foreground &
sleep 5
/wp-install.sh
sudo -u www-data chmod 755 /wp-install.sh
sudo -u www-data /wp-install.sh
tail -f /dev/null
EOF

RUN chmod 755 /start.sh
RUN chown -R www-data /var/www

USER www-data
RUN wp core download && \
wp config create --skip-check --dbhost=db --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --locale=de_DE
RUN sudo -u www-data wp core download && \
sudo -u www-data wp config create --skip-check --dbhost=db --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --locale=de_DE

# make sure copy the wp-install script at the end
USER root
COPY ./wp-install.sh /wp-install.sh
RUN chmod 755 /wp-install.sh

USER www-data
CMD ["/start.sh"]
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ services:
context: .
volumes:
- wp_data:/var/www/html
- ./wp-install.sh:/wp-install.sh
- ./:/var/www/html/wp-content/plugins/wc-orderitem-rearrange
- ./msmtprc:/etc/msmtprc
ports:
Expand Down

0 comments on commit f1afadf

Please sign in to comment.