Skip to content

POC: Introduce Debian Stretch with Nginx #821

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

Closed
wants to merge 1 commit into from

Conversation

S1lverhead
Copy link

Contains POC of nginx + php-fpm based on Debian Stretch
Supports dynamic configuration for nginx.conf using bash script + sed.
Nginx Perl & Lua modules doesn't allow to modify top level vars(user,pidfile).

Reason for this PR - I'd like to introduce Nextcloud based on Nginx
They use upstream apache-php image as a basic

Image variant
php:-nginxFpm-stretch
This image is based on Debian Stretch and Nginx.
PHP contains support for FPM.

Please review code, I look forward to your feedback
This code doesn't contain code rejected in PRs:
#818
#817

Image can be pulled using: docker.io/1john2/php:latest

Signed-off-by: Malanik Jan malanik.jan@gmail.com

Contains POC of nginx + php-fpm based on Debian Stretch
Supports dynamic configuration for nginx.conf using bash script + sed.
Nginx Perl & Lua modules doesn't allow to modify top level vars(user,pidfile).

Reason for this PR - I'd like to introduce Nextcloud based on Nginx
They use upstream apache-php image as a basic

Image variant
php:<version>-nginxFpm-stretch
This image is based on Debian Stretch and Nginx.
PHP contains support for FPM.

Please review code, I look forward to your feedback
This code doesn't contain code rejected in PRs:
docker-library#818
docker-library#817

Image can be pulled using: docker.io/1john2/php:latest

Signed-off-by: Malanik Jan <malanik.jan@gmail.com>
@brzuchal
Copy link

brzuchal commented Apr 30, 2019

What is the motivation behind bundling nginx with php-fpm in the same container?
What about scalability?

@S1lverhead
Copy link
Author

S1lverhead commented Apr 30, 2019 via email

@yosifkit
Copy link
Member

yosifkit commented May 1, 2019

Duplicate of #54, #161, #406.

While the work is admirable, we do not have container images with an un-managed background process in the official-images. We also don't usually have multiple processes in one container that would require a init-like system (supervisord, runit, s6, etc).

Our recommendation for nginx with php-fpm is as follows:

This really should be handled by using two containers linked together [via] Docker Networks, or some other method

- #54 (comment)

@yosifkit yosifkit closed this May 1, 2019
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 8, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_ncd.sh (temporary)
    + Helper script to handle nextcloud container
  - start_fpm.sh (temporary)
    + Helper script to handle fpm container
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Signed-off-by: Malanik Jan <malanik.jan@gmail.com>
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 8, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_ncd.sh (temporary)
    + Helper script to handle nextcloud container
  - start_fpm.sh (temporary)
    + Helper script to handle fpm container
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Signed-off-by: Malanik Jan <malanik.jan@gmail.com>
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 8, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_ncd.sh (temporary)
    + Helper script to handle nextcloud container
  - start_fpm.sh (temporary)
    + Helper script to handle fpm container
  - Dockerfile
    + /Dockerfile for verification purposes
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Signed-off-by: Malanik Jan <malanik.jan@gmail.com>
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 8, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_ncd.sh (temporary)
    + Helper script to handle nextcloud container
  - start_fpm.sh (temporary)
    + Helper script to handle fpm container
  - Dockerfile
    + /Dockerfile for verification purposes
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Image pull link:
docker pull malanik.guru:443/nextcloud:apache-20190508
docker pull malanik.guru:443/nextcloud:fpm-20190508
Github link:
Deployment notes:
  - Clone source code
  - Create user-defined network for Docker
  - Start fpm container
  - Start nginx container
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 9, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_ncd.sh (temporary)
    + Helper script to handle nextcloud container
  - start_fpm.sh (temporary)
    + Helper script to handle fpm container
  - Dockerfile
    + /Dockerfile for verification purposes
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Image pull link:
docker pull malanik.guru:443/nextcloud:apache-20190508
docker pull malanik.guru:443/nextcloud:fpm-20190508
Github link:
Deployment notes:
  - Clone source code
  - Create user-defined network for Docker
  - Start fpm container
  - Start nginx container
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 9, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_container.sh (temporary)
    + Helper script to handle containers
  - Dockerfile
    + /Dockerfile for verification purposes
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Image pull link:
docker pull malanik.guru:443/nextcloud:apache-20190508
docker pull malanik.guru:443/nextcloud:fpm-20190508
Github link:
Deployment notes:
  - Clone source code
  - Create user-defined network for Docker
  - Start fpm container
  - Start nginx container
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 9, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_container.sh (temporary)
    + Helper script to handle containers
  - Dockerfile
    + /Dockerfile for verification purposes
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Image pull link:
docker pull malanik.guru:443/nextcloud:apache-20190508
docker pull malanik.guru:443/nextcloud:fpm-20190508
Github link:
Deployment notes:
  - Clone source code
  - Create user-defined network for Docker
  - Start fpm container
  - Start nginx container
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 9, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_container.sh (temporary)
    + Helper script to handle containers
  - Dockerfile
    + /Dockerfile for verification purposes
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Image pull link:
docker pull malanik.guru:443/nextcloud:apache-20190508
docker pull malanik.guru:443/nextcloud:fpm-20190508
Github link:
Deployment notes:
  - Clone source code
  - Create user-defined network for Docker
  - Start fpm container
  - Start nginx container
S1lverhead added a commit to S1lverhead/docker that referenced this pull request May 9, 2019
This PR introduce POC of Nextcloud based on Nginx web server with php-fpm in separated container.
Basic installation with SQLite and few operations in web gui were tested.

Updated Dockerfile-debian.template (base for apache image) is used in current version.
  - It's not possible to use nginx:latest as a base image - Image will not be alligned.
  - It's not possible to use "php:%%PHP_VERSION%%-%%VARIANT%%-stretch" it generates 7.3-nginx-stretch tag which is invalid(non-existing image) for upstream base PHP
Potential solutions of this problem:
  - Custom tags in Debian template and generate Nginx from current Dockerfile-debian.template with customizations
  - PR to PHP upstream with Nginx+php-fpm in one container was rejected - it's not scalable: docker-library/php#821
  - Change of way how we generate tags/Dockerfiles

PR for PHP upstream with Nginx+php-fpm in one
New files were introduced:
  - Dockerfile-nginx.template
  - nginx-foreground
    + simulates behavior of apache2-foreground cmd
  - 16.0/nginx/Dockerfile
    + generated from template Dockerfile-nginx.template
  - nextcloud.confx
    + Nginx vhost configuration
  - start_net.sh (temporary)
    + Helper script to create user-defined network for Docker
    + '--link' option for docker create is obsolete and we need communication between fpm and nginx container
  - start_container.sh (temporary)
    + Helper script to handle containers
  - Dockerfile
    + /Dockerfile for verification purposes
Updated files:
  - set -x added to all shell scripts for easier troubleshooting (temporary)
  - Dockerfile-debian.template - changes required to generate Nginx container until permanent fix will be done
  - update.sh
    + New variant introduced
    + Number of builded variant is limited for simplified CI.
  - .travis.yml (temporary)
    + Upload to private repository for testing purposes
  - docker-entrypoint.sh
    + Recognizes new argument for entrypoint - nginx-foreground

Be careful during review, github recognizes removed files for 15.0 release as renamed to 16.0/nginx variant

Motivation:
  - I have openvz based VPS where only old Docker 1.10 is supported.
  - Apache(in nextcloud container) in combination Nginx as a reverse proxy for multiple vhosts doesn't work correctly

Image pull link:
docker pull malanik.guru:443/nextcloud:apache-20190508
docker pull malanik.guru:443/nextcloud:fpm-20190508
Github link:
Deployment notes:
  - Clone source code
  - Create user-defined network for Docker
  - Start fpm container
  - Start nginx container
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.

3 participants