Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a php dependency only image without wordpress specific files #764

Open
jooola opened this issue Oct 8, 2022 · 4 comments
Open
Labels
question Usability question, not directly related to an error with the image

Comments

@jooola
Copy link

jooola commented Oct 8, 2022

Could it be possible for the WordPress docker image to provide a php dependency only tag variant ?

The regular image currently provides a zip with a version of WordPress and a custom entry point. But you sometimes do not need thoses files and they might also mess your custom setup (for example extracting WP while it shouldn't).

It would be great if this current image is split into 2 stages, one for the php dependencies, and the next one for the wordpress specific files. This should allow me to reuse the wordpress image to build my own docker image ?

I would see maybe a stage around here:

We could then have for example:

FROM wordpress:apache-bare

COPY . /var/www/html
@wglambert wglambert added the question Usability question, not directly related to an error with the image label Oct 11, 2022
@wglambert
Copy link

@jooola
Copy link
Author

jooola commented Oct 11, 2022

I guess that's the idea, but including all the php extensions and settings required/recommended by wordpress.

@gerwinjansen
Copy link

My goal is to bring my Wordpress based application under version control. I'm using PHP Composer and roots/bedrock to compose my webroot directory and I use a .env file for the settings and secrets.
Next, I want to create a docker image from this webroot directory with a volume for the upload directory and a docker secret for the .env file.
The ultimate goal is to setup a DTAP cycle to deliver my application.

I prefer to use an official docker image from Wordpress so that I don't have to do the maintenance of PHP configuration and extensions myself.
I can replace the /usr/src/wordpress/ with my webroot and I found a workaround for the Entrypoint.
But I can't 'undo' the volume of the official image. Hence my support for this request.

Workarounds I can think off:

  1. Make a copy of the official Docker file, watch for changes and manually apply patches if needed.
  2. Copy operating system files from the official image to my own image.

Both are not very attractive.

@jooola
Copy link
Author

jooola commented Jan 27, 2023

I used a dirty workaround for now (feel free to propose some improvement):

FROM wordpress:6.1-php8.0-apache as wordpress

RUN set -eux; \
    rm -Rf \
    /usr/local/bin/docker-entrypoint.sh \
    /usr/src/wordpress \
    /var/www/html/*

FROM scratch
COPY --from=wordpress / /

CMD ["apache2-foreground"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

3 participants