add: improved workflow for caprover
This commit is contained in:
@@ -1,8 +1,28 @@
|
||||
ARG WP_VERSION=6
|
||||
ARG PHP_VERSION=8.3
|
||||
|
||||
# set wordpress and PHP versions
|
||||
FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-fpm-alpine
|
||||
|
||||
# clean core from default themes and plugins
|
||||
RUN rm -rf /usr/src/wordpress/wp-content/themes/* && rm -rf /usr/src/wordpress/wp-content/plugins/*
|
||||
COPY app/* /usr/src/wordpress
|
||||
|
||||
# install system dependencies
|
||||
RUN apk add --no-cache msmtp mysql-client;
|
||||
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
|
||||
|
||||
# install composer dependencies
|
||||
COPY composer.json composer.lock ./
|
||||
RUN --mount=type=secret,id=GITEA_TOKEN \
|
||||
export TOKEN=$(cat /run/secrets/GITEA_TOKEN) && \
|
||||
composer config --global auth.http-basic.seu-gitea.com token $TOKEN && \
|
||||
composer install --no-dev --optimize-autoloader
|
||||
|
||||
# modify docker entrypoint for running any .sh scripts found under /usr/local/bin/docker-entrypoint.d
|
||||
# scripts will run as www-data if endedd with .unpriv.sh or as root elsewhere
|
||||
RUN cp -avf /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.original && \
|
||||
sed -i '/^[[:space:]]*exec "$@"[[:space:]]*/d' /usr/local/bin/docker-entrypoint.sh && \
|
||||
cat << EOF >> /usr/local/bin/docker-entrypoint.sh
|
||||
@@ -20,11 +40,6 @@ fi
|
||||
|
||||
exec "\$@";
|
||||
EOF
|
||||
COPY docker/wordpress/scripts/docker-entrypoint.d/* /docker-entrypoint.d/
|
||||
|
||||
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 sub scripts and allows execution
|
||||
COPY ./scripts/docker-entrypoint.d/* /docker-entrypoint.d/
|
||||
RUN chmod +x /docker-entrypoint.d/*.sh
|
||||
Reference in New Issue
Block a user