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

Add nginx to docker base image #395

Merged
merged 1 commit into from
Dec 22, 2020
Merged

Add nginx to docker base image #395

merged 1 commit into from
Dec 22, 2020

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Dec 21, 2020

This drops separate nginx container, and therefore avoids the need to synchronize data with fpm and nginx container with webroot volume.

The webroot volume is a source of annoyance when its content changes.
need to prune the volume to catch up updates from it.

For the end-users, they needed to stop containers, remove xhgui_webroot-share docker volume manually.

Note: On upgrade need to delete old container:

$ docker-compose down --rm-orphans
  • Cleanup: www-data group is provided by nginx package
  • Add volume for nginx pid
  • Launch nginx before fpm
  • Link nginx logs to stdout/stderr

Note: This switches php-fpm user to www-data (was mistakenly nobody).

/var/www/xhgui # ps axwuf
PID   USER     TIME  COMMAND
    1 root      0:00 php-fpm: master process (/etc/php7/php-fpm.conf)
    8 root      0:00 nginx: master process nginx
    9 nginx     0:00 nginx: worker process
   10 nginx     0:00 nginx: worker process
   11 nginx     0:00 nginx: worker process
   12 nginx     0:00 nginx: worker process
   13 www-data  0:01 php-fpm: pool www
   14 www-data  0:00 php-fpm: pool www
/var/www/xhgui #

@glensc glensc added this to the Next milestone Dec 21, 2020
@glensc glensc self-assigned this Dec 21, 2020
@glensc glensc modified the milestones: 0.17.1, Next Dec 22, 2020
This avoids need to synchronize data with fpm and nginx container with
webroot volume.

The webroot volume is source of annoyance when it's content changes.
need to prune the volume to catch up updates from it.

- Cleanup: www-data group is provided by nginx package
- Add volume for nginx pid
- Launch nginx before fpm
- Link nginx logs to stdout/stderr
- Fix php-fpm user/group to be www-data
- Fix fpm errors to be logged to /var/log/php/fpm.error.log, Which in turn is redirected to stderr, so logged to docker
- Move paths setup all together
@glensc glensc merged commit 4b502b1 into master Dec 22, 2020
@glensc glensc deleted the nginx-inline-drop-volume branch December 22, 2020 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant