I use docker to build an environment using php-fpm+nginx+mysql.
We are going to mount the php configuration file on the host in /etc/php of the docker container (app container) so that the changes on the host side can be reflected in the container.
I am currently rewriting the php configuration file, but I can see that it is reflected on the terminal of the app container, but the value that I see when I access it from the browser through phpinfo has not been changed, so I am at a loss why.
It seems that the ini you set is not wrong, and I was able to confirm that /etc/php is mounted.
As a reflection procedure after the configuration change, restarting php-fpm on the app container will cause the container to fall off (because it is running in the foreground process), so I regenerated all containers (php-fpm, nginx, mysql) (rm the container shown in docker ps-a and re-launching all related containers).
I have a guess, but since the sequence at the time of container startup automatically starts php-fpm and then mounts, I wonder if the host rewrite will not be reflected in php-fpm.
■On the app container (it has been changed on the terminal)
root@70e3ff96a942:/#php-i | grep "post_max\|upload_max"
post_max_size=>64M=>64M (2M before change)
upload_max_filesize=>64M=>64M (2M prior to change)
■ docker-compose file
mysql:
image:<myregistry>:5000/hogehoge/image_resize_mysql
ports:
- 3306:3306
volumes:
- local/etc/mysql:/etc/mysql
- /data/log/mysql:/var/log/mysql
tty —true
app:
image:<myregistry>:5000/hogehoge/image_resize_app
volumes:
- local /etc/php: /etc/php
- /data/log/image_resize: /var/log/image_resize
- .../:/var/app
links:
- mysql
tty —true
nginx:
image:<myregistry>:5000/hogehoge/image_resize_nginx
ports:
- 80:80
- 443:443
volumes:
- local /etc/nginx: /etc/nginx
- /data/log/nginx: /var/log/nginx
- .../:/var/app
links:
- app
tty —true
■Confirmed settings in phpinfo (not 64M)
■The configuration file (php.ini) that you can see in phpinfo has been rewritten.
■Dockerfile of app container
FROM ubuntu:14.04
ENV PATH $PATH: /usr/bin
ENV DEBIAN_FRONTEND noninteractive
# Avoid ERROR:invoke-rc.d:policy-rc.d denied execution of start.
RUN sed-i"s/^exit101$/exit0/"/usr/sbin/policy-rc.d
RUN apt-get update
RUN apt-get-y install apt-file
RUN apt-file update
RUN apt-file search add-apt-repository
RUN apt-get-y install software-properties-common
RUN apt-get install-y language-pack-en-base
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5267A6C
RUN LC_ALL = C.UTF-8 add-apt-repository-yppa —ondrej/php
RUN apt-get update
RUN apt-get-y install php 5.6-mcrypt php 5.6-mbstring php 5.6-curl php 5.6-cli php 5.6-mysql php 5.6-gd php 5.6-intl php 5.6-xsl php 5.6-zip php 5.6-fpm
COPY. / launch.sh / launch.sh
ENTRYPOINT ["/bin/bash", "/launch.sh"]
Regarding this matter, I did not go to see the ini file because the loaded configuration file was php-fpm.conf.Therefore, this case has been resolved
*I made a mistake in the comment section about resolving this issue, so I will also post it in this answer section
© 2024 OneMinuteCode. All rights reserved.