GithubHelp home page GithubHelp logo

mileschou / docker-phalcon Goto Github PK

View Code? Open in Web Editor NEW
124.0 7.0 41.0 139 KB

Dockerized Phalcon

Home Page: https://hub.docker.com/repository/docker/mileschou/phalcon

License: MIT License

Makefile 25.79% Shell 25.72% Dockerfile 48.50%
docker phalcon php

docker-phalcon's Introduction

Docker Phalcon

Phalcon Version Phalcon devtools ci

Docker Phalcon base image, see DockerHub.

The repository is a Docker image based on Docker official PHP image with Phalcon Framework.

The Phalcon Action is Use GitHub Actions with this image.

Variants for Phalcon

It's only support PHP 7.4 since Phalcon 5.0.0 release. We will keep the old Docker image, but we will not to update old image.

The dockerfile with old Phalcon versions can be found at branchs:

Image Test

Here is a simple test command that can confirm the extension has been loaded & check version.

$ docker run -it --rm mileschou/phalcon:alpine sh -c "php --ri phalcon | grep -i ^version" 
Version => 4.0.0

Running a php script

$ docker run -v ${PWD}:/usr/src/app -w /usr/src/app mileschou/phalcon:7.4-cli php script.php

Install phalcon/devtools

docker-phalcon-install-devtools is a script to install latest release of Phalcon Devtools CLI.

Here is usage example:

$ docker run -it --rm mileschou/phalcon docker-phalcon-install-devtools
>>> Downloading phalcon.phar ...
>>> Testing 'phalcon --version' command ...

Phalcon DevTools (4.0.0)

Environment:
  OS: Linux 4e17aa4d915d 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64
  PHP Version: 7.4.1
  PHP SAPI: cli
  PHP Bin: /usr/local/bin/php
  PHP Extension Dir: /usr/local/lib/php/extensions/no-debug-non-zts-20190902
  PHP Bin Dir: /usr/local/bin
  Loaded PHP config: 
Versions:
  Phalcon DevTools Version: 4.0.0
  Phalcon Version: 4.0.0
  AdminLTE Version: 2.3.6

Build yourself

Recommend 2G+ RAM when build image yourself. Maybe wait a long time for compile if only 1G RAM.

Memo

List the variants of Docker official PHP:

make variants

Thanks

Contributors

docker-phalcon's People

Contributors

amazingdreams avatar danielcosta avatar fizzka avatar georgebekh avatar mileschou avatar pwoszczyk avatar ruudboon avatar vincedziree 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  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  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

docker-phalcon's Issues

Uncaught Phalcon\Mvc\Micro\Exception: Not-Found

Description:
I am encountering an issue with running a Docker image that I obtained from your repository. The image fails to execute and throws an "Uncaught Phalcon\Mvc\Micro\Exception: Not-Found" error. However, I have confirmed that I have the correct image from your repository.

Steps to Reproduce:

Pull the Docker image from the repository.
Start the container using the pulled image.
Attempt to run the necessary commands or access the application within the container.
Observe the "Uncaught Phalcon\Mvc\Micro\Exception: Not-Found" error.

My Minimal index.php code:

`<?php

use Phalcon\Mvc\Micro;

$app = new Micro();

$app->get(
'/api/robots',
function () {
echo 'hello';
}
);

$app->handle(
$_SERVER["REQUEST_URI"]
);`

Expected Behavior:
The Docker image should successfully run without any errors and allow access to the application within the container.

Additional Information:

I have ensured that I am using the correct image from your repository.
I have reviewed the documentation and followed the required steps for running the container.
I have tried pulling the image again to rule out any potential issues with the image itself.
I have verified that all the necessary dependencies are installed and configured correctly.
I have examined the logs, but they do not provide any further insights into the issue.

Environment:

Docker version: 23.0.6, build ef23cbc
Operating System: Fedora 38 (MATE-Compiz)

Please let me know if any additional information or logs are required to troubleshoot this issue.

strange build behavior

if I pull image from autobuilded docker hub - php periodically coredumped (on different virtual machines).
if I build image manually - thats ok.

tested image: 7.1/alpine

Wrong PHP version in fpm-alpine

My Dockerfile is using mileschou/phalcon:fpm-alpine as base image. Running phpinfo() on this tells me that I have PHP Version 7.0.30. Same result when checking it in cli via docker exec.
According to the description, this image should give me version 7.2, so something's not right.

docker-compose build php-7.4

I get this error when I build

FROM php:7.4-fpm

step 7/7 : COPY docker-phalcon-* /usr/local/bin/
ERROR: Service 'phalcon_php' failed to build: COPY failed: no source files were specified

improve module enabling

what about to replace low-level
echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/phalcon.ini
with bundled
docker-php-ext-enable phalcon
?

COPY failed: no source files were specified

hi, I have a problem building
Step 7/7 : COPY docker-phalcon-* /usr/local/bin/
COPY failed: no source files were specified
I don't know how go find the docker-phalcon-* file, if i don't complete this step, will it affect the use ?

How to use this image

Hi!
Great job here. Please can you make a small guide on how to use this image?

When I look at it many questions come into my mind like

  • How do I serve my project with this image? a small php script will do for example sake
  • How do I alter apache config?

I copied this from some php docker image readme

FROM php:7.0-apache
COPY config/php.ini /usr/local/etc/php/
COPY src/ /var/www/html/

Personally I need this short guide in the doc. Thanks

alpine image not functional

docker run -i -t --rm mileschou/phalcon:alpine php -m

output:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/phalcon.so' - Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20160303/phalcon.so: No such file or directory in Unknown on line 0
[PHP Modules]
Core
ctype
curl
[...]

Phalcon updates

Hello, can you please update phalcon devtools to 4.0.1 and Phalcon to 4.0.2?

Run Dockerfile failed on Win 11 + Docker

Hi I tried to run the docker file from apache-7.4 with pahlcon-4.1.2. It had build the image but didn't start a container. I'm super new to docker and asking for some help here :)

this is my output when I run the docker file in my intellij

Deploying 'apache-7-4-phalcon-4-1-2 Dockerfile: 7.4/apache/Dockerfile'�
Building image�
Preparing build context archive�
[==================================================>]1/1 files
Done

Sending build context to Docker daemon�
[==================================================>]  594,0B
Done

Step 1/7 : FROM php:7.4-apache
 ---> 20a3732f422b
Step 2/7 : LABEL maintainer="MilesChou <github.com/MilesChou>, fizzka <github.com/fizzka>"
 ---> Using cache
 ---> d345afa5ccef
Step 3/7 : ARG PSR_VERSION=1.1.0
 ---> Using cache
 ---> 7706539c8a52
Step 4/7 : ARG PHALCON_VERSION=4.1.2
 ---> Using cache
 ---> 1ebc79e04b89
Step 5/7 : ARG PHALCON_EXT_PATH=php7/64bits
 ---> Using cache
 ---> 0bfa4ddac463
Step 6/7 : RUN set -xe &&         curl -LO https://github.com/jbboehr/php-psr/archive/v${PSR_VERSION}.tar.gz &&         tar xzf ${PWD}/v${PSR_VERSION}.tar.gz &&         curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz &&         tar xzf ${PWD}/v${PHALCON_VERSION}.tar.gz &&         docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN)             ${PWD}/php-psr-${PSR_VERSION}             ${PWD}/cphalcon-${PHALCON_VERSION}/build/${PHALCON_EXT_PATH}         &&         rm -r             ${PWD}/v${PSR_VERSION}.tar.gz             ${PWD}/php-psr-${PSR_VERSION}             ${PWD}/v${PHALCON_VERSION}.tar.gz             ${PWD}/cphalcon-${PHALCON_VERSION}         &&         php -m
 ---> Using cache
 ---> 011a4405bc21
Step 7/7 : COPY docker-phalcon-* /usr/local/bin/
Error response from daemon: COPY failed: no source files were specified
Failed to deploy 'apache-7-4-phalcon-4-1-2 Dockerfile: 7.4/apache/Dockerfile': Can't retrieve image ID from build stream

phalcon compilation failed

This has been stopped:
gcc -I. -I/var/www/html/cphalcon-3.0.0/build/php7/64bits -DPHP_ATOM_INC -I/var/www/html/cphalcon-3.0.0/build/php7/64bits/include -I/var/www/html/cphalcon-3.0.0/build/php7/64bits/main -I/var/www/html/cphalcon-3.0.0/build/php7/64bits -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -march=native -mtune=native -O2 -fomit-frame-pointer -fvisibility=hidden -c /var/www/html/cphalcon-3.0.0/build/php7/64bits/phalcon.zep.c -fPIC -DPIC -o .libs/phalcon.o
I do not know how to do it?

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.