GithubHelp home page GithubHelp logo

dmstr / docker-php-yii2 Goto Github PK

View Code? Open in Web Editor NEW
99.0 14.0 33.0 169 KB

:whale: :cd: Docker PHP image containing extensions and libraries for Yii 2.0 Framework

Shell 8.99% PHP 78.92% Makefile 0.55% Hack 11.54%
docker docker-php-image php base-image yii2

docker-php-yii2's Introduction

๐Ÿšจ This repository is abandoned, please use https://github.com/yiisoft/yii2-docker

Supported tags and respective Dockerfile links

โ„น๏ธ See repository tags for full version numbers

See all available image tags

build status

Changelog

8.x

  • using updated yii2 images
    • different system package installation
    • composer 2
  • removed standalone fpm image

7.x

  • switched to PHP 7.4

6.x

  • Alpine support has been dropped
  • Forego has been replace with supervisord
  • Removed Linkchecker

5.x

no stable release

4.x

  • added bash-autocompletion
  • removed separate xdebug flavour

Introduction

This is a Docker PHP image containing PHP extensions and composer packages and libraries for Yii 2.0 Framework. It is primarily intended to build Yii 2.0 applications FROM this image, see below for available application templates.

There is also an nginx flavour available for this image, in which PHP and nginx are managed with supervisor.

In older versions of the nginx images, forego was used for process control. However, since forego is no longer actively maintained and problems can arise if one of the started processes terminates unsuspectedly, we decided to switch to supervisor.

Features

CLI commands

  • composer
  • codecept
  • phpunit
  • npm

Extensions

  • soap
  • zip
  • curl
  • bcmath
  • exif
  • gd
  • iconv
  • intl
  • mbstring
  • opcache
  • pdo_mysql
  • pdo_pgsql
  • memcache
  • xdebug - installed, but not loaded by default

Configuration

ENV variables

  • GITHUB_API_TOKEN
  • PHP_ENABLE_XDEBUG
  • PHP_USER_ID (debian only)

Development

Building the images

docker-compose build

Development bash

docker run -it dmstr/php-yii2 bash

Resources


dmstr logo Built by dmstr

docker-php-yii2's People

Contributors

handcode avatar michaelarnauts avatar schmunk42 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

Watchers

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

docker-php-yii2's Issues

Enable xdebug

How would I go to enable xdebug? I understand I change it in the dockerfile to enable, but probably need more than that?

I'm working from PHPStorm with the docker plugin enabled.

yii phpunit and codecept with permission denied upon run on GCE

How to reproduce:

  1. Mount a VM with a container optimized image in GCE
  2. start up a container with the alpine nginx 7.2 image
  3. exec a bash
  4. try to run "yii migrate" ( for example) . results in permission denied.

workaround:
use $php ./file
In my local environment(windows) this doesn't happen. Only on GCE. composer works.
Thanks for the great work !

Support HTTP/2 in nginx image

In order for the Yii2 container to support we need to build against OpenSSL 1.0.2 or later. Current latest-nginx builds against 1.0.1t.

Ways this could be accomplished:

Debian

  1. Add jessie-backports to sources.list, install nginx
  2. FROM php:7.2-fpm, which uses stretch

Alpine

  • Nginx in v3.3 and later branch should support although I have not confirmed

We should then also add http2 to the listen directive for nginx config.

Question. Image updates

Hi, guys,

Is project alive? Is there any plans to update images? Current PHP 7.2 images are about 3 month old.

Add PHP 7.1

Is there any possibility to make another version of image for php 7.1.1, like latest stable?

Change containers' config

If, for example, one have need to change nginx and/or php-fpm own user from www-data to some other, how it supposed to be done correctly?

Only 7.0-fpm in docker hub

Hi,

thanks for this images. I tried to pull version 7.1-fpm as it was said to be available in README. But it is not pushed to hub.

Would be nice to have available 7.1-fpm and/or 7.1-fpm-alpine

Greetings,
David

Pcntl for php

One of the project's module needs Pcntl extension could you enable it or should it be done by myself?

build error

hi

ERROR: Service 'php' failed to build: The command '/bin/sh -c curl -sS https://getcomposer.org/installer | php --         --filename=composer.phar         --install-dir=/usr/local/bin &&     composer global require --optimize-autoloader         "fxp/composer-asset-plugin:${VERSION_COMPOSER_ASSET_PLUGIN}"         "hirak/prestissimo:${VERSION_PRESTISSIMO_PLUGIN}" &&     composer global dumpautoload --optimize &&     composer clear-cache' returned a non-zero code: 127```

Add beanstalk to own container extended from your image

As I uderstand I could extend your box and add everything I want so I just ask maybe you could give some hints how to add beanstalk service. I'm just new to Docker stuff. I saw phd 5 repository, you've used Redis there.

Setting timezone in php.ini

I'm using dmstr/php-yii2:7.2-fpm-4.6-alpine-nginx as base image. Really great!

How can I set the timezone in PHP ini-settings?

Can I do this in my docker-compose.yml file?

Is there an ENV-Variable for the timezone?

Time zone problem

I tried to change time zone inside a container and didn't get result that suppose to happen in vanilla alpine container. gliderlabs/docker-alpine#136 (comment)

But trying same on your image I get different result

phd root container 2406abc9ab16 /app
$ date
Thu Nov  2 04:28:10 UTC 2017
phd root container 2406abc9ab16 /app
$ apk add --no-cache tzdata
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
fetch http://dl-3.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/1) Installing tzdata (2016d-r0)
Executing busybox-1.24.2-r13.trigger
OK: 209 MiB in 83 packages
phd root container 2406abc9ab16 /app
$ date
Thu Nov  2 04:28:29 UTC 2017
phd root container 2406abc9ab16 /app
$ export TZ='Asia/Almaty'
phd root container 2406abc9ab16 /app
$ date
Thu Nov  2 04:29:39 +06>-6 2017
phd root container 2406abc9ab16 /app

Difference in this thing +06>-6. In usual alpine I get changed time but here I get same UTC time but with this thing.

Session problem in 7.1 php-fpm-nginx-xdebug

Php throws this error in session module Could not gather sufficient random data.
It looks there is a problem with alpine and/or latest php 7.1.2
docker-library/php#376

I installed image about week ago, now It works fine, it uses older version of php 7.1.1, but new installation includes php 7.1.2 which throws above error. What would be correct way to rollback?

Package fxp/composer-asset-plugin at version ^1.4.1 has a PHP requirement incompatible with your PHP version

Hi,
I am using dmstr/php-yii2:7.1-fpm-3.2-alpine-nginx docker image. facing below issue.

Use composer self-update --rollback to return to version 1.5.2
Changed current directory to /root/.composer

[InvalidArgumentException]
Package fxp/composer-asset-plugin at version ^1.4.1 has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] []...

The command '/bin/sh -c composer config -g github-oauth.github.com ${GITHUB_TOKEN} && composer self-update && composer global require "fxp/composer-asset-plugin:^1.4.1"

How can i solve it.

tried : "fxp/composer-asset-plugin:dev-master"

Question: is memcached dependency dropped from the last images?

After update site throws MemCache requires PHP memcached extension to be loaded.
And here's make bash command

sudo -E docker-compose run --rm php bash
Starting app_db_1 ... done
Starting app_cache_1 ... done
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/memcached.so' - Error loading shared library libmemcached.so.11: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20160303/memcached.so) in Unknown on line 0
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
(1/3) Installing binutils-libs (2.26-r1)
(2/3) Installing binutils (2.26-r1)
(3/3) Installing .docker-php-ext-enable-deps (0)
Executing busybox-1.24.2-r13.trigger
OK: 211 MiB in 79 packages
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/memcached.so' - Error loading shared library libmemcached.so.11: No such file or directory (needed by /usr/local/lib/php/extensions/no-debug-non-zts-20160303/memcached.so) in Unknown on line 0

warning: xdebug (xdebug.so) is already loaded!

(1/3) Purging .docker-php-ext-enable-deps (0)
(2/3) Purging binutils (2.26-r1)
(3/3) Purging binutils-libs (2.26-r1)
Executing busybox-1.24.2-r13.trigger
OK: 202 MiB in 76 packages
Enabled xdebug

Update:
Here's problem I think 53ee35a#diff-c2e069b42908be807edca1773d3f529cR89

[Q] How to use cron?

I noticed that cron is available in this image.
What is the best way to schedule a cron job, eg: for yii queue/run?

I tried creating a file and putting it in /etc/cron.d, but it doesn't seem to execute. No logging, and the command gives no sign of any effects.

Below is the content of my cron file
* * * * * root php /app/yii queue/run > /proc/1/fd/1 2>/proc/1/fd/2

Is this the correct way to use cron here?

Updating images

Hello,
Are you planning further development? Will there be an image updates?

Imagick hasn't been installed properly

Here I found working way to install

RUN set -x \
    && apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS imagemagick-dev libtool \
    && pecl install imagick \
    && docker-php-ext-enable imagick \
    && apk add --no-cache --virtual .imagick-runtime-deps imagemagick \
    && apk del .phpize-deps

docker-library/php#105

Is "8.1-fpm-8.0-beta1-nginx" production ready?

Hi!,

Thanks for this great docker image!!

Just I'm wondering if "8.1-fpm-8.0-beta1-nginx" is production ready or if anybody is using it in serious project... any hints?

Many thanks!

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.