Comments (2)
Two ways to configure docker container.
- The image has a mechanism for this. Typically it's an env variable. You go to https://hub.docker.com/_/wordpress Read the doc and guess that "-e WORDPRESS_CONFIG_EXTRA=... (defaults to nothing, non-empty value will be embedded verbatim inside wp-config.php -- especially useful for applying extra configuration" will do the trick.
To check this you go to https://github.com/docker-library/wordpress to look in the Dockerfile or the docker-entrypoint.sh
And in line 151 you see that the content of WORDPRESS_CONFIG_EXTRA is copied into wp-config.php
https://github.com/docker-library/wordpress/blob/0df5de06a4f43f2790dfc3be92554a7e229115d9/php7.3/fpm-alpine/docker-entrypoint.sh#L151
Looks good. For me.
So I would define a variable app_php_config in https://github.com/ReinerNippes/selfhosted_on_docker/blob/master/group_vars/wordpress.yml
And add to the docker task https://github.com/ReinerNippes/selfhosted_on_docker/blob/master/roles/docker_wordpress/tasks/wordpress.yml#L5 an env: parameter https://docs.ansible.com/ansible/latest/modules/docker_container_module.html#parameter-env
You may test it without the variable definition.
- If that doesn't work. You have to find the place of the php config files in the container. Dockerfile/docker-entrypoint.sh are again a good start. Seems that /usr/local/etc/php is the path you have to look for. https://github.com/docker-library/wordpress/blob/0df5de06a4f43f2790dfc3be92554a7e229115d9/php7.3/fpm-alpine/Dockerfile#L53
You may log into the container with a command like thisdocker exec -it app-wordpress /bin/sh
and examine how the php is read. I guess there is ainclude /usr/local/etc/php/conf.d/*.php
somewhere. To get your config inside the container you create a file on the host and add this as a volume to the container.
The syntax you can find here:
from selfhosted_on_docker.
Waouhh!! very well documented. Thank you for your very helpful help.
I choose option 2 and add the php.ini file in /usr/local/etc/php/conf.d/
with a volume command.
https://github.com/Nickous/selfhosted_on_docker/commit/5bea4a358ceab8f2a401f738cd0cae6d6e07fd8e
from selfhosted_on_docker.
Related Issues (8)
- error message by install HOT 14
- DEPRECATION: Python 2.7 HOT 1
- Nextcloud creation - database creation fails - ./prepare_site.yml - mysql only HOT 20
- small correction to comments in selfhosted_sites.yml HOT 3
- Portainer not available when use PathPrefixStrip HOT 3
- Feature Request: Adding Draw.io server (e.g. for Nextcloud integration) HOT 1
- Vcc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from selfhosted_on_docker.