trafex / docker-wordpress Goto Github PK
View Code? Open in Web Editor NEWWordPress container with Nginx 1.20 & PHP-FPM 8.3 based on Alpine Linux
Home Page: https://hub.docker.com/r/trafex/wordpress/
License: MIT License
WordPress container with Nginx 1.20 & PHP-FPM 8.3 based on Alpine Linux
Home Page: https://hub.docker.com/r/trafex/wordpress/
License: MIT License
Hello! I have runned previous versions of this image without issues, but since the last update to WP v6.1 I am getting an error that drops the WP container a second after it starts.
Error in the log reads:
exec /usr/local/bin/entrypoint.sh: no such file or directory
Building without the ENTRYPOINT line solves the startup issue, however we don't get that script executed. The files get copied correctly and has +x access mode.
I am running Docker Desktop v 4.12.0 in Windows 11.
I stumbled upon this article. I wonder if a built-in letsencrypt client that automates free SSL server certificate generation and renewal processes can be done in this build.
I install WooCommerce plugin and found a strange behavior. Whenever I try to logout from my account page (the endpoint is /my-account/customer-logout/?_wpnonce=db71110b59
) does not seem to invalidate my current session. But if I try to logout from wordpress wp-login.php
(the endpoint is /wp-login.php?action=logout&_wpnonce=6d96f8c37a
, it works. How to solve this problem? Is this related to nginx
configuration?
Hey @TrafeX nice work!
Quick question, do you plan to support PHP8 based setup?
If not, do you foresee any issues using this same setup with PHP8?
Thanks!
Explicitly setting the environment variables to false sets the options to true within Wordpress.
At the very least, this should be documented behavior. Ideally, a fix would check the value of the environment variables and not just whether they are set.
Hey, whenever I try to run your WordPress docker image, I get this error in my web browser...
Please help?
-BigDC
Hi Tim,
Sorry in advance, i'm quite new at docker stuff.
I wuld like to know what's the best way to import an existing wordpress with your docker hub.
Modify the Dockerfile to add a custom-db.sh which will import the database and modify few stuff or use wp-cli that you installed in it ?
Regards,
Morgan
WordPress 6.4.2 was released Dec. 6.
Hi,
The default configuration does not display any PHP errors in the docker logs.
docker container logs CONTAINER-NAME -f only shows the access log but not any PHP errors.
Is there anything I should be setting to make it work?
thanks in advance.
https://docs.docker.com/compose/compose-file/compose-versioning/#version-3
First off, your work here absolutely splendid. And I don't want to take too much of your time. I'm just curious if you've considered or would consider what it might take to move to Compose 3 and allow scaling for WP instances distributed in a swarm.
With Galera it looks like Maria DB is also setting up for distributed clustering, which, with a version 3, should tee others up to allow the database to be scaled in a swarm.
Is this crazy? IDK but here's a prototype: https://github.com/jlk/wordpress-swarm
Aside: I noticed the latest stable of Maria DB introduces the opportunity to do some cool stuff with JSON and also the ability to swap out Inno with the same tool powering http://rocksdb.org/, which has some potential to decrease footprint of the store as well as memory consumption. Obviously rolling DB versions forward isn't something one ought to be doing frequently - or so I'd assume - so I'm just dropping this in here for the sake of consideration WRT swarming.
i got an error exec /entrypoint.sh: no such file or directory after docker-compose up..please help me
Hello,
Trying to understand why set WP_CONTENT_DIR outside ABSPATH, because it is not working well, the file uploads keeps sending files to /usr/src/wordpress/w-content
not
/var/www/wp-content
In his 2016 article titled How to deploy a wordpress blog on docker cloud in less than 5 minutes, Aurélien Hervé describes a simple technique for enabling backup and restore functionality for data held in the database as well as the wp-content
directories.
His method uses Docker Cloud and Compose v3 to achieve this capability. While not necessarily required here, I'm curious to hear your thoughts on making backup and restore functionality possible within the current toolset so critical site backup and restore functionality may be achieved using an external provider and in a scripted manner.
If this is already possible, could you enlighten us to your technique?
Hello
I've a problem when i launch your container.
In my logs i see
CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
I try to add user=root
in config/supervisord.conf in the [supervisord] section but nothing change.
Do you have a solution?
Thank you for your work
There is currently a environment variable called WORDPRESS_SITE_URL
WORDPRESS_SITE_URL: http://localhost
How should it be used in production?
Hi, wp-secrets.php only gets generated when the volume is empty. However, once the volume is there and the container has to restart for whatever reason (e.g. when moving a pod to another node on k8s) the wp-secrets.php won't be recreated since the volume already exists.
I think it should be passed with a separate volume instead.
docker-wordpress/entrypoint.sh
Line 14 in 8ca167b
Hi Sir,
I have seen your code and its really awesome.
Since I am just a beginner and am learning devops recently , I would like to know how to deploy the same in an amazon ECS
I have pushed the image to amazon ECR and I need to provision docker containers now using ECS , Would you please show me a way for the same.
Who i work with the wp-content folder? example for developer a theme with local access
With the stock wordpress container (wordpress:php5.6
) you can omit the env variables to e.g. connect to the database using any existing settings in a mounted wordpress directory volume. This makes upgrading a breeze (so long as you get your networking settings right).
This image, however, doesn't seem to honor an existing wp-config.php file. Do you have any suggestions for customizing and rebuilding to change this behavior?
Hello!
Thank you for creating docker-wordpress.
I have a problem and I need advice.
I would like to make this wordpress a subdirectory.
ex)http://example.com/wordpress/~~~~
So I have made the following settings.
location /wordpress/ {
try_files $uri $uri $uri/ /wordpress/index.php?q=$uri$is_args$args;
}
Is there anything I can do to help?
Please help us.
Thanks.
Hi,
I disable wp-cli installation since it is not needed all the time. Running long command using docker exec also gives:
PHP Warning: levenshtein(): Argument string(s) too long in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/utils.php on line 1186
Instead I try to use the standard way of using wp-li container:
docker run -d
--name wpcli
--net xnet
--volumes-from xgm
--workdir=/usr/src/wordpress
--user=82:82
wordpress:cli-php7.2
sh -c '
wp --path=/usr/src/wordpress core install --url=example.com --title="TEST" --admin_user=admin --admin_password="dfsdsdw" --admin_email=[email protected]
then I get:
docker logs wpcli
Error: This does not seem to be a WordPress install.
Pass --path=path/to/wordpress
or run wp core download
.
Am I missing something? I am not familiar with alpine.
Thanks for your help in advance.
Hi @TrafeX, thanks for this great image. After a first investigation, it looks muuuuch better than the official ones.
When migrating a few sites from https://hub.docker.com/_/wordpress to this image, I noticed an issue with the secrets which is already outlined in #36. As this was closed long time ago and didn't receive any update, I decided to open this here.
So, the persistent volume is mounted to /var/www/wp-content
, but the secrets are in /usr/src/wordpress/wp-secrets.php
which is NOT part of the volume. When updating or recreating the container, the file reverts to the original state without secrets defined:
docker-compose exec wordpress bash -l
curl -f https://api.wordpress.org/secret-key/1.1/salt/ >> /usr/src/wordpress/wp-secrets.php
exit
docker-compose up -d --force-recreate wordpress
docker-compose exec wordpress bash -l
cat /usr/src/wordpress/wp-secrets.php
Output of last command shows:
<?php
/** Generated file based on https://api.wordpress.org/secret-key/1.1/salt/ */
This is obviously missing the secrets. Besides --force-recreate
this also happens when pulling a new image version or changing an environment variable for the container.
Same issue happens with a copied-over volume as described in #36 (comment) -- however in contrast to @mdbraber I think secrets should NOT be regenerated during image updates but persisted and manually rotated.
I now considered setting the constants from https://api.wordpress.org/secret-key/1.1/salt/ as environment variables because they are currently passed to define
in wp-config.php. However, if this ticket is fixed, this would lead to warnings, so maybe this combination is something to keep in mind when fixing it.
Hi,
Thanks for the image.
Is it possible to add a new feature checking if WordPress database exists and if not create it using the credential passed as env variables?
Thanks!
docker-compose exec wordpress /usr/local/bin/wp --path=/usr/src/wordpress status
returns
env: can't execute 'php': No such file or directory
This is because the first line in /usr/local/bin/wp
is #!/usr/bin/env php
but there is no php
binary in PATH or existing at all. But there is php82, so this works:
docker-compose exec wordpress /usr/bin/php82 /usr/local/bin/wp --path=/usr/src/wordpress help
If it is intentional to not have a php executable, the shebang line could be changed, which will lead to problems with its code signature etc. -- so I guess we should have a php executable?
I know this is a common security bug/issue, not sure what to do though. Installs perfectly, CSS fine, I have SSL HTTPS Certs working OK, On a Ubuntu 16.4 Cloud Server.
Error on this page: /wp-admin/
Actually Logs in/authenticates OK which you can see going back to root
Using mysql:5.6 container is one difference, rather than Maria DB.
Any advice? Going through various logs atm, thanks
https://docs.docker.com/compose/compose-file/compose-versioning/#version-2
The
depends_on
option can be used in place of links to indicate dependencies between services and startup order.
Seems links
may no longer be necessary. Have you tried pulling it?
I issued the provided command with the port changed from 80:80 to 8080:80 and everything started up properly, however when I navigated to localhost:8080, it throws a "Error establishing a database connection" error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.