Git Product home page Git Product logo

php-zendserver-docker's Introduction

PHP-ZendServer

This is a cluster-enabled version of a Dockerized Zend Server container. With Zend Server on Docker, you'll get your PHP applications up and running on a highly available PHP production environment which includes, amongst other features, a highly reliable PHP stack, application monitoring, troubleshooting, and the new and innovative new technology - Z-Ray. Z-Ray gives developers unprecedented visibility into their code by tracking and displaying in a toolbar live and detailed info on how the various elements constructing their page are performing.

For development purposes we provide you with a time limited trial license. For production use you must provide a valid Zend Server license using the instructions below in the Usage section.

Usage

Launching the Container from Docker-Hub

Zend Server is shared on Docker-Hub as php-zendserver.

  • To start a single Zend Server instance, execute:

      $ docker run php-zendserver
    
  • You can specify the PHP and Zend Server version by adding ':' or ':<ZS-version>-php<version>' to the 'docker run' command. Availible PHP version are 5.6 & 7.1 (7.1 is the default) and Zend Server versions 9 or8 (for example: php-zendserver:8.5-php5.6).

  • To start a Zend Server cluster, execute the following command for each cluster node:

      $ docker run -e MYSQL_HOSTNAME=<db-ip> -e MYSQL_PORT=3306 -e MYSQL_USERNAME=<username> -e MYSQL_PASSWORD=<password> -e MYSQL_DBNAME=zend php-zendserver
    
  • To use your own Zend Server license $ docker run php-zendserver -e ZEND_LICENSE_KEY= -e ZEND_LICENSE_ORDER=

Launching the Container from Dockerfile

  • From a local folder containing this repo's clone, execute the following command to generate the image. The image-id will be outputted:

      $ docker build .
    
  • To start a single Zend Server instance, execute:

      $ docker run <image-id>
    
  • To start a Zend Server cluster, execute the following command on each cluster node:

      $ docker run -e MYSQL_HOSTNAME=<db-ip> -e MYSQL_PORT=3306 -e MYSQL_USERNAME=<username> -e MYSQL_PASSWORD=<password> -e MYSQL_DBNAME=zend <image-id>
    

Specifying License details

If you wish to bring your own license you can do so by setting the following environment variables:

Accessing Zend server

Once started, the container will output the information required to access the PHP application and the Zend Server UI, including an automatically generated admin password.

To access the container remotely, port forwarding must be configured, either manually or using docker. For example, this command redirects port 80 to port 88, and port 10081 (Zend Server UI port) to port 10088:

    $ docker run -p 88:80 -p 10088:10081 php-zendserver

For clustered instances:

    $ docker run -p 88:80 -p 10088:10081 -e MYSQL_HOSTNAME=<db-ip> -e MYSQL_PORT=3306 -e MYSQL_USERNAME=<username> -e MYSQL_PASSWORD=<password> -e MYSQL_DBNAME=zend <image-id>

Please note, that when running multiple instances only one instance can be bound to a port. If you are running a cluster, either assign a port redirect to one node only, or assign a different port to each container.

Adding application files

Application files can be automatically pulled from a Git repo by setting the GIT_URL env var to the repo's URL. Alternatively, if building an image from Dockerfile, place the app files in the "app/" folder.

The files will be copied to the containers /var/www/html folder and defined in Zend Server as the default app. An example index.html file is included. this feature is available in Zend Server 8 and above.

Env variables

Env variables are passed in the run command with the "-e" switch.

Optional env-variables:

To specify a pre-defined admin password for Zend Server use:

  • ZEND_ADMIN_PASSWORD

Automatically Deploy an app from Git URL:

  • GIT_URL

MySQL vars for clustered ops. ALL are required for the node to properly join a cluster:

  • MYSQL_HOSTNAME - ip or hostname of MySQL database
  • MYSQL_PORT - MySQL listening port
  • MYSQL_USERNAME
  • MYSQL_PASSWORD
  • MYSQL_DBNAME - Name of the database Zend Server will use for cluster ops (created automatically if it does not exist).

To specify a pre-purchased license use the following env vars:

  • ZEND_LICENSE_KEY
  • ZEND_LICENSE_ORDER

Set Zend Server to production mode by setting the following env var to "true". By default Zend Server is set to "development mode" with Z-Ray enabled:

  • ZS_PRODUCTION

Minimal Requirements

  • Each Zend Server Docker container requires 1GB of availible memory.

php-zendserver-docker's People

Contributors

andrus7k avatar aneto88 avatar bqcuong avatar burkl avatar davidl-zend avatar dror-g avatar hsinilind avatar rainviigipuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-zendserver-docker's Issues

-e ZS_PRODUCTION=true doesn't seem to disable z-ray

When I set the environment variable ZS_PRODUCTION=true, it doesn't seem to disable z-ray footer. Is there something else I need to do to get this work, or am I better off just adding "RequestHeader set ZRAY-DISABLE 1" in .htaccess file to disable it?

Unable to see logs in Cloudwatch

We are currently having an issue that will not allow us to see any Apache or Zend logs via CloudWatch. It seems by going the default route of starting up the docker it takes over all STDout/err even if we symlink the log files.

Is this a know issue or is there a work around?

Zend Server license Expired.

Looks like the license attached to the container is expired. The last time it was updated, the expire date was 3/31/2017 which was last week. Any chance this gets extended?

Zend Server only comes in Nginx and no apache2

Hey,
I was wondering if there is a docker container that ships Zend Server with apache?
I see there was one which we used, but now its only using Nginx. And no release note to it being dropped?

The configurations we have already set are for example: the working directory settings and override rules.

Unable to start Zend Server cluster

I have mysql container deployed on my machine. It works fine.
I'm trying to run zend server by following:

$ docker run -d -p 80:80 -p 10081:10081 -e MYSQL_HOSTNAME=172.17.0.8 -e MYSQL_PORT=3306 -e MYSQL_USERNAME=root -e MYSQL_PASSWORD=P@ssw0rd -e MYSQL_DBNAME=zend -e ZS_ADMIN_PASSWORD=P@ssw0rd --name=php4 php-zendserver

After that a container is created and works a few minutes.
Here are a logs:

Starting Zend Server 7.0.0 ..

Starting Zend Server Monitor node [OK]
[21.04.2015 08:38:38 SYSTEM] watchdog for monitor is running. 
[21.04.2015 08:38:38 SYSTEM] monitor is running. 
 * Starting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.10. Set the 'ServerName' directive globally to suppress this message
 * 
spawn-fcgi: child spawned successfully: PID: 146
Starting Zend Server GUI [Lighttpd] [OK]
[21.04.2015 08:38:41 SYSTEM] watchdog for lighttpd is running. 
[21.04.2015 08:38:41 SYSTEM] lighttpd is running. 
Starting Session Clustering daemon [OK]
[21.04.2015 08:38:42 SYSTEM] watchdog for scd is running. 
[21.04.2015 08:38:42 SYSTEM] scd is running. 
Starting Deployment [OK]
[21.04.2015 08:38:43 SYSTEM] watchdog for zdd is running. 
[21.04.2015 08:38:43 SYSTEM] zdd is running. 
Starting JobQueue [OK]
[21.04.2015 08:38:44 SYSTEM] watchdog for jqd is not running. 
[21.04.2015 08:38:44 SYSTEM] jqd is not running. 
Starting ZendServerDaemon [OK]
[21.04.2015 08:38:45 SYSTEM] watchdog for zsd is running. 
[21.04.2015 08:38:45 SYSTEM] zsd is running. 

Zend Server started...
Bootstrapping single server
Error: failed accessing Zend Server through the Web API
WebAPI error message : License key is invalid
WebAPI error code    : internalServerError
Joining cluster
Error: failed accessing Zend Server through the Web API
WebAPI error message : Failed retrieving server data for server a76b4bf07e47 - the server may have not been added to the cluster
WebAPI error code    : internalServerError
Error: authentication error. check your API key details
restarting Zend Server
Error: authentication error. check your API key details
Zend Server is ready for use
Your application is available at http://172.17.0.10
To access Zend Server, navigate to http://172.17.0.10:10081
Your admin password is P@ssw0rd
Usage:
/usr/local/bin/nothing <mysql-hostname> <mysql-port> <mysql-username> <mysql-password> <mysql-db-name> <server-id> <web-api-key-name> <web-api-key>

Please, help me

2018.0 On redirect does not load login

The image builds good, and runs.
On initial request to the container IP and port 10081, the redirect to login does not complete rendering the login page. Prior version 9.1 works fine.

Launch Fail on Docker Windows - php-zendserver:8.5-php5.6

When trying to run the docker with the following command:

docker run --name zend -p 10081:10081 -p 10082:10082 -p 80:80 php-zendserver:8.5-php5.6

I get the following error on the console:

/usr/local/bin/nothing: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

The error happened on Docker for Windows, Windows 10.

failed to build php-zendserver docker on apache httpd

I tried to run PHP 7.3 and it failed to initialize the Zend Server package. Any idea?

Step 11/23 : RUN curl -fSL -o zs-init.tar.gz "http://repos.zend.com/zs-init/zs-init-docker-${ZS_INIT_VERSION}.tar.gz"     && echo "${ZS_INIT_SHA256} *zs-init.tar.gz" | sha256sum -c -     && mkdir /usr/local/zs-init     && tar xzf zs-init.tar.gz --strip-components=1 -C /usr/local/zs-init     && rm zs-init.tar.gz
 ---> Running in 05ecbcd588e1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
**_curl: (22) The requested URL returned error: 503 Service Unavailable_**
ERROR: Service 'php7.3-zendserver' failed to build: The command '/bin/sh -c curl -fSL -o zs-init.tar.gz "http://repos.zend.com/zs-init/zs-init-docker-${ZS_INIT_VERSION}.tar.gz"     && echo "${ZS_INIT_SHA256} *zs-init.tar.gz" | sha256sum -c -     && mkdir /usr/local/zs-init     && tar xzf zs-init.tar.gz --strip-components=1 -C /usr/local/zs-init     && rm zs-init.tar.gz' 
returned a non-zero code: 22
make: *** [iup] Error 1

How to add additional modules (like mcrypt)

In the php dockerhub image, we can do the following:

docker-php-ext-install -j$(nproc) iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd

Is there a similar way in this base image to do the same as we need a zend application to have mcrypt installed.

Composer 2.x breaks ZendServer Composer plugin

Currently using Zend Server 9.1.10+b202 on Ubuntu 16.04

Using the default composer installation command in Docker installs the new 2.x version:

RUN /usr/local/zend/bin/php -r "readfile('https://getcomposer.org/installer');" | /usr/local/zend/bin/php \
    && /usr/local/zend/bin/php composer.phar self-update \
    && /usr/local/zend/bin/php composer.phar update

Docker run command: winpty docker run -e "ZS_ADMIN_PASSWORD=a" --rm -it -p 88:80 -p 10088:10081 -v //c/Users/Ejohnson8/docker_tmp:/tmp --privileged=true --name zs_docker zs_docker

Launching ZS via the standard /usr/local/bin/run file results in the following errors:

Zend Server initialization result: success.
Zend Server is ready for use
Your application is available at http://172.17.0.2
To access Zend Server, navigate to http://172.17.0.2:10081
Your admin password is
Notice: Trying to get property of non-object in /usr/local/zend/var/plugins/composer/zray/zray.php on line 48
Notice: Trying to get property of non-object in /usr/local/zend/var/plugins/composer/zray/zray.php on line 49
Notice: Trying to get property of non-object in /usr/local/zend/var/plugins/composer/zray/zray.php on line 63
Notice: Trying to get property of non-object in /usr/local/zend/var/plugins/composer/zray/zray.php on line 48
Notice: Trying to get property of non-object in /usr/local/zend/var/plugins/composer/zray/zray.php on line 49
Notice: Trying to get property of non-object in /usr/local/zend/var/plugins/composer/zray/zray.php on line 63
a
/usr/local/bin/run: line 37: [: too many arguments
Adding Node Id to DB table for sigterm handler
Usage:
/usr/local/bin/nothing <mysql-hostname> <mysql-port> <mysql-username> <mysql-password> <mysql-db-name> <server-id> <web-api-key-name> <web-api-key>

Root cause is the JSON format of installed.json has changed and can no longer be parsed by the plugin.

1.x format:

[
     {
         "name": "aws/aws-sdk-php",
         "version": "2.8.31",
         "version_normalized": "2.8.31.0",
         "source": {
             "type": "git",
             "url": "https://github.com/aws/aws-sdk-php.git",
             "reference": "64fa4b07f056e338a5f0f29eece75babaa83af68"
         },

2.x format:

{
     "packages": [
         {
             "name": "aws/aws-sdk-php",
             "version": "2.8.31",
             "version_normalized": "2.8.31.0",
             "source": {
                "type": "git",
                "url": "https://github.com/aws/aws-sdk-php.git",
                "reference": "64fa4b07f056e338a5f0f29eece75babaa83af68"
            },

Current (temporary) workaround is to force version 1.x during install:
&& /usr/local/zend/bin/php composer.phar self-update --1 \

Lighttpd permission denied on php-fastcgi.socket

I've tried this image with Docker 1.5.0. The Zend Server backend is not reachable, because of the following error (from lighttpd.error.log):

2015-02-23 21:15:33: (mod_fastcgi.c.2550) unexpected end-of-file (perhaps the fastcgi process died): 11 Permission denied
2015-02-23 21:15:33: (mod_fastcgi.c.3346) response not received, request sent: 830 on socket: unix:/usr/local/zend/gui/lighttpd/tmp/php-fastcgi.socket for /ZendServer/index.php?, closing connection

Is this a known problem?

Launch fail due to fatal error

Using this command
docker run --name php -p 80:80 -p 443:443 -p 10081:10081 php-zendserver

I am able to browse to: http://127.0.0.1:10081/ZendServer/

And see the Wizard UI. When I enter admin passwords etc, I can click next until the launch page.

When I click on Launch, it appears to do something, but then eventually hangs and does nothing and reports the following:

capture

Also, the following is what I see as output from the console since I wasn't running in detached mode.

docker run --name php -p 80:80 -p 443:443 -p 10081:10081 php-zendserver
Error: HTTP code 500
Zend Server initialization result: failed.
Zend Server is ready for use
Your application is available at http://172.17.0.2
To access Zend Server, navigate to http://172.17.0.2:10081
Your admin password is OTdjOWFk

Is this a Windows issue?

I just copied down the repo, built the image with no issues, but when I try to run the image I get:
standard_init_linux.go:190: exec user process caused "no such file or directory"

The only thing I changed was to edit the zend.lic file to add my real license info.

I also tried to run the Docker hub version, and while that seems to complete without issue, it does not mount my application, nor does it allow me access to the ZendServer instance. It outputs that I can access the instance at http://172.17.0.2:10081 but nothing loads at that URL. If I ping my Docker subnet I get a response from it, but if I ping 172.17.0.2 I get nothing.

Any thoughts on either?

Thank you.

FYI: My system is a freshly installed Windows 10 Pro, running Docker version 18.03.1-ce-win65 (17513)

PHP 7.4 Support

Is it in pipeline or in progress the support for Zendserver 2020 and php 7.4?
A lot of framework now asking for php 7.4 as requirement so it's hard working with your dockerized zendFramework.

Thank you
Andrea.

External Link Error

I use percona database for multi container. So, I prefer to use external_links.

version: '2.0'
services:
    zend:
        image: php-zendserver:8.5
        ports:
            - 80:80
            - 10081:10081
            - 10082:10082
        volumes:
            - ./code/:/var/www/html/
        external_links:
            - percona
        environment:
            MYSQL_HOSTNAME: percona 
            MYSQL_USERNAME: root
            MYSQL_PASSWORD: 123456
            ZS_ADMIN_PASSWORD: admin
    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        ports:
            - 81:80
        external_links:
            - percona:db
        environment:
            PMA_HOST: db
            PMA_USER: root
            PMA_PASSWORD: 123456
        network_mode: 'bridge'

This is the error message

zend_1        | Usage:
zend_1        | /usr/local/bin/nothing <mysql-hostname> <mysql-port> <mysql-username> <mysql-password> <mysql-db-name> <server-id> <web-api-key-name> <web-api-key>
zend_zend_1 exited with code 1

PHP 5.6 Zend 8.5 Docker image is not updated to use latest Dockerfile

The php-zendserver image tagged 8.5-php5.6 is still using base ubuntu 14.04 which is lagging changes to latest apache server capabilities and security patches. Please push the latest image from Master branch Dockerfile

  • Current Docker Image in reference: 5.6, 8.5-php5.6, 8.5 (8.5/5.6/Dockerfile)
https://github.com/zendtech/php-zendserver-docker/blob/78105bf7c9123abbb432ddba50d73ecb482062ca/8.5/5.6/Dockerfile

VS

  • Latest
https://github.com/zendtech/php-zendserver-docker/blob/master/8.5/5.6/Dockerfile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.