[[email protected] ~]$ git clone https://github.com/phalcon/phalcon-compose phalcon

Cloning into 'phalcon'...

remote: Counting objects: 759, done.

remote: Total 759 (delta 0), reused 0 (delta 0), pack-reused 759

Receiving objects: 100% (759/759), 165.43 KiB | 444.00 KiB/s, done.

Resolving deltas: 100% (387/387), done.

[[email protected] ~]$ cd phalcon/

[[email protected] phalcon]$ ll

total 96K

drwxr-xr-x. 10 user user 4.0K Mar 14 20:55 .

drwx------. 5 user user 4.0K Mar 14 20:55 ..

drwxr-xr-x. 2 user user 4.0K Mar 14 20:55 bin

drwxr-xr-x. 2 user user 4.0K Mar 14 20:55 cache

-rw-r--r--. 1 user user 1.4K Mar 14 20:55 composer.json

drwxr-xr-x. 4 user user 4.0K Mar 14 20:55 conf

drwxr-xr-x. 3 user user 4.0K Mar 14 20:55 data

drwxr-xr-x. 3 user user 4.0K Mar 14 20:55 docker

-rw-r--r--. 1 user user 2.3K Mar 14 20:55 docker-compose.yml

-rw-r--r--. 1 user user 378 Mar 14 20:55 .editorconfig

-rw-r--r--. 1 user user 312 Mar 14 20:55 Gemfile

-rw-r--r--. 1 user user 1.2K Mar 14 20:55 Gemfile.lock

drwxr-xr-x. 8 user user 4.0K Mar 14 20:55 .git

-rw-r--r--. 1 user user 106 Mar 14 20:55 .gitattributes

-rw-r--r--. 1 user user 407 Mar 14 20:55 .gitignore

-rw-r--r--. 1 user user 1.1K Mar 14 20:55 LICENSE.txt

drwxr-xr-x. 2 user user 4.0K Mar 14 20:55 logs

-rw-r--r--. 1 user user 3.2K Mar 14 20:55 Makefile

-rw-r--r--. 1 user user 685 Mar 14 20:55 Rakefile

-rw-r--r--. 1 user user 1.4K Mar 14 20:55 README.md

-rw-r--r--. 1 user user 31 Mar 14 20:55 .rspec

drwxr-xr-x. 3 user user 4.0K Mar 14 20:55 spec

-rw-r--r--. 1 user user 1.1K Mar 14 20:55 .travis.yml

-rw-r--r--. 1 user user 990 Mar 14 20:55 variables.env.example

[[email protected] phalcon]$ cp variables.env.example variables.env

[[email protected] phalcon]$ docker-compose build

mysql uses an image, skipping

Building app

Step 1/5 : FROM phalconphp/php-apache:ubuntu-16.04

ubuntu-16.04: Pulling from phalconphp/php-apache

50aff78429b1: Extracting [=================================> ] 28.9MB/42.74MB

f6d82e297bce: Pull complete

275abb2c8a6f: Pull complete

9f15a39356d6: Pull complete

fc0342a94c89: Pull complete

bd285114816e: Pull complete

00783529147d: Pull complete

eef9321c141c: Pull complete

6550209004c0: Pull complete

cbf97f04c200: Pull complete

52468f0294cc: Pull complete

19d6bf313571: Pull complete

bce5c0bac6bf: Pull complete

ee25109c0e9a: Pull complete

3bb98286a7ab: Pull complete

c0fb70f592e0: Pull complete

45d9e3f1cd1c: Pull complete

2db7c78b673d: Pull complete

705b0d5b53b6: Pull complete

ea9f3511d755: Pull complete

78a2e910e7c7: Pull complete

cdebb2b81f7b: Pull complete

32867ae27dfc: Pull complete

877562230694: Pull complete

Digest: sha256:a96dc62d654908d3988cc3063ce39560b3b5a4e85eaf6f1a2df75582620527ce

Status: Downloaded newer image for phalconphp/php-apache:ubuntu-16.04

---> 2743a216fc05

Step 2/5 : MAINTAINER Serghei Iakovlev [email protected]

---> Running in 2770926d1545

Removing intermediate container 2770926d1545

---> f08626be5008

Step 3/5 : ENV PROVISION_CONTEXT "development"

---> Running in e61de62eed6f

Removing intermediate container e61de62eed6f

---> 13674e0ebacf

Step 4/5 : COPY bin/*.sh /opt/docker/provision/entrypoint.d/

---> 91d94d46d18b

Step 5/5 : RUN mkdir -p /vendor && composer --working-dir=/vendor require ph
alcon/devtools && ln -s /vendor/vendor/phalcon/devtools/phalcon.php /usr/loc
al/bin/phalcon && chmod ugo+x /usr/local/bin/phalcon && chmod +x /opt/do
cker/provision/entrypoint.d/*.sh

---> Running in b004d6a80831

Using version ^3.2 for phalcon/devtools

./composer.json has been created

Loading composer repositories with package information

Updating dependencies (including require-dev)

Package operations: 11 installs, 0 updates, 0 removals

  • Installing jakub-onderka/php-console-color (0.1): Downloading (100%)

  • Installing jakub-onderka/php-console-highlighter (v0.3.2): Downloading (100%)

  • Installing dnoegel/php-xdg-base-dir (0.1): Downloading (100%)

  • Installing nikic/php-parser (v3.1.5): Downloading (100%)

  • Installing symfony/polyfill-mbstring (v1.7.0): Downloading (100%)

  • Installing symfony/var-dumper (v3.4.6): Downloading (100%)

  • Installing psr/log (1.0.2): Downloading (100%)

  • Installing symfony/debug (v3.4.6): Downloading (100%)

    • Installing symfony/console (v3.4.6): Downloading (100%)

    • Installing psy/psysh (v0.8.17): Downloading (100%)

    • Installing phalcon/devtools (v3.2.12): Downloading (100%)

symfony/var-dumper suggests installing ext-symfony_debug ()

symfony/console suggests installing symfony/event-dispatcher ()

symfony/console suggests installing symfony/lock ()

symfony/console suggests installing symfony/process ()

psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)

psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)

Writing lock file

Generating autoload files

Removing intermediate container b004d6a80831

---> b13f78c20c21

Successfully built b13f78c20c21

Successfully tagged phalcon_app:latest

[[email protected] phalcon]$ docker-compose up -d

Creating network "phalcon_default" with the default driver

Creating volume "phalcon_mysql" with local driver

Pulling mysql (mysql:5.7)...

5.7: Pulling from library/mysql

2a72cbf407d6: Pull complete

38680a9b47a8: Pull complete

4c732aa0eb1b: Pull complete

c5317a34eddd: Pull complete

f92be680366c: Pull complete

e8ecd8bec5ab: Pull complete

2a650284a6a8: Pull complete

5b5108d08c6d: Pull complete

beaff1261757: Pull complete

c1a55c6375b5: Pull complete

8181cde51c65: Pull complete

Digest: sha256:691c55aabb3c4e3b89b953dd2f022f7ea845e5443954767d321d5f5fa394e28c

Creating phalcon_mysql_1 ... done

Creating phalcon_mysql_1 ...

Creating phalcon_app_1 ... done

[[email protected] phalcon]$ ll

total 100K

drwxr-xr-x. 10 user user 4.0K Mar 14 20:56 .

drwx------. 5 user user 4.0K Mar 14 20:55 ..

drwxr-xr-x. 2 user user 4.0K Mar 14 20:55 bin

drwxr-xr-x. 2 user user 4.0K Mar 14 20:55 cache

-rw-r--r--. 1 user user 1.4K Mar 14 20:55 composer.json

drwxr-xr-x. 4 user user 4.0K Mar 14 20:55 conf

drwxr-xr-x. 3 user user 4.0K Mar 14 20:55 data

drwxr-xr-x. 3 user user 4.0K Mar 14 20:55 docker

-rwxrw-rw-. 1 user user 700 Mar 14 20:57 docker-compose.yml

-rw-r--r--. 1 user user 378 Mar 14 20:55 .editorconfig

-rw-r--r--. 1 user user 312 Mar 14 20:55 Gemfile

-rw-r--r--. 1 user user 1.2K Mar 14 20:55 Gemfile.lock

drwxr-xr-x. 8 user user 4.0K Mar 14 20:55 .git

-rw-r--r--. 1 user user 106 Mar 14 20:55 .gitattributes

-rw-r--r--. 1 user user 407 Mar 14 20:55 .gitignore

-rw-r--r--. 1 user user 1.1K Mar 14 20:55 LICENSE.txt

drwxr-xr-x. 2 user user 4.0K Mar 14 20:55 logs

-rw-r--r--. 1 user user 3.2K Mar 14 20:55 Makefile

-rw-r--r--. 1 user user 685 Mar 14 20:55 Rakefile

-rw-r--r--. 1 user user 1.4K Mar 14 20:55 README.md

-rw-r--r--. 1 user user 31 Mar 14 20:55 .rspec

drwxr-xr-x. 3 user user 4.0K Mar 14 20:55 spec

-rw-r--r--. 1 user user 1.1K Mar 14 20:55 .travis.yml

-rwxrw-rw-. 1 user user 769 Mar 14 20:56 variables.env

-rw-r--r--. 1 user user 990 Mar 14 20:55 variables.env.example

[[email protected] phalcon]$ docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

7f24f0ceccb6 phalcon_app "/entrypoint supervi…" 18 seconds ago Up 13 seconds 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 9000/tcp
phalcon_app_1

58fa96c9cc6e mysql:5.7 "docker-entrypoint.s…" 19 seconds ago Up 17 seconds 0.0.0.0:3306->3306/tcp
phalcon_mysql_1

[[email protected] phalcon]$ docker exec -it phalcon_app_1 phalcon project application simple

Phalcon DevTools (3.2.12)

Success: Controller "index" was successfully created.

/project/application/app/controllers/IndexController.php

Success: Project 'application' was successfully created.

Please choose a password and username to use Database connection. Used default:'root' without password.

[[email protected] phalcon]$ cat variables.env

MySQL settings

MYSQL_ROOT_PASSWORD=votmdnjem

MYSQL_DATABASE=cube

MYSQL_USER=cube

MYSQL_PASSWORD=gozj

Application

WEB_DOCUMENT_ROOT=/project/application/public

WEB_ALIAS_DOMAIN=phalcon.local

APPLICATION_CACHE=/project/cache

APPLICATION_LOGS=/project/logs

production | development | staging | testing

APPLICATION_ENV=development

Debug

Note: For debugging purposes you have to setup Xdebug by passing required parameters

PHP_DEBUGGER=xdebug

Please provide your host (local machine IP) instead of 192.168.1.129

XDEBUG_REMOTE_HOST=192.168.1.129

php.ini value for xdebug.remote_port

XDEBUG_REMOTE_PORT=9000

php.ini value for xdebug.remote_autostart

XDEBUG_REMOTE_AUTOSTART=0

php.ini value for xdebug.remote_connect_back

XDEBUG_REMOTE_CONNECT_BACK=0

[[email protected] phalcon]$ cat docker-compose.yml

version: '2'

services:

mysql:

restart: always

image: mysql:5.7

expose:

  • "3306"

ports:

  • "3306:3306"

volumes:

  • ./data/mysql:/docker-entrypoint-initdb.d

  • mysql:/var/lib/mysql

  • ./conf/mysql/my.cnf:/etc/mysql/conf.d/my.cnf

env_file:

  • variables.env

app:

build: docker/app

restart: always

working_dir: /project

ports:

  • "80:80"

  • "443:443"

volumes:

  • .:/project

  • ./conf/php/cli.ini:/etc/php/7.0/cli/conf.d/99-custom.ini

  • ./conf/php/fpm.ini:/etc/php/7.0/fpm/conf.d/99-custom.ini

depends_on:

  • mysql

env_file:

  • variables.env

volumes:

mysql:

driver: local

[[email protected] phalcon]$ docker --version

Docker version 17.12.1-ce, build 7390fc6

[[email protected] phalcon]$ docker-compose --version

docker-compose version 1.19.0, build 9e633ef

i use centos and ubuntu in docker... same 503 error...

but not use docker no have error...

plz help me!

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.4.18 (Ubuntu) Server at 192.168.0.6 Port 80