forked from ankitpokhrel/tus-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: Use official php docker image (ankitpokhrel#311)
- Loading branch information
1 parent
c3bd393
commit 7217839
Showing
9 changed files
with
88 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,52 @@ | ||
FROM phpearth/php:7.3-nginx | ||
FROM php:7.3-fpm-alpine | ||
|
||
LABEL maintainer="[email protected],[email protected]" \ | ||
description="This builds tus-php-base image" | ||
|
||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
ENV PHP_INI_DIR /etc/php/7.3 | ||
ENV PHP_INI_DIR /usr/local/etc/php | ||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
|
||
ADD https://repos.php.earth/alpine/phpearth.rsa.pub /etc/apk/keys/phpearth.rsa.pub | ||
|
||
RUN ln -sf /usr/share/zoneinfo/Asia/Kathmandu /etc/localtime | ||
|
||
RUN apk update && apk add --no-cache \ | ||
php7.3-imap \ | ||
php7.3-intl \ | ||
php7.3-mbstring \ | ||
php7.3-openssl \ | ||
php7.3-ldap \ | ||
php7.3-curl \ | ||
php7.3-pcntl \ | ||
php7.3-dev \ | ||
php7.3-pear \ | ||
composer | ||
|
||
# Install APCu and Xdebug extension. | ||
RUN pecl upgrade apcu xdebug | ||
make \ | ||
supervisor \ | ||
nginx \ | ||
php7-imap \ | ||
php7-intl \ | ||
php7-curl \ | ||
composer \ | ||
curl \ | ||
ca-certificates | ||
|
||
# Install required extensions. | ||
RUN docker-php-ext-install pcntl | ||
|
||
# Install pecl extensions. | ||
# | ||
# Some dependencies like c-compiler and autoconf are only required | ||
# to compile pecl extensions. However, these dependencies take a | ||
# lot of space. Therefore, we will remove these dependencies | ||
# after installing the required extensions. | ||
RUN apk add --no-cache g++ autoconf && \ | ||
pecl upgrade apcu xdebug && \ | ||
apk del g++ autoconf | ||
|
||
COPY ./bin/xdebug.sh /bin/xdebug | ||
RUN chmod +x /bin/xdebug | ||
|
||
# There are some default configurations from the image that will override | ||
# our php-fpm settings and we don't want that. To avoid that, we will | ||
# delete all configurations available by default. Also, we will | ||
# create a folder for the php-fpm socket. | ||
RUN mkdir -p /var/run/php-fpm && rm -rf /usr/local/etc/php-fpm.d/*.conf | ||
|
||
COPY ./configs/supervisord.conf /etc/supervisord.conf | ||
COPY ./configs/nginx.conf /etc/nginx/nginx.conf | ||
COPY ./configs/php.ini $PHP_INI_DIR/php.ini | ||
COPY ./configs/xdebug.ini $PHP_INI_DIR/conf.d/00_xdebug.disable | ||
COPY ./configs/www.conf $PHP_INI_DIR/php-fpm.d/www.conf | ||
COPY ./configs/www.conf /usr/local/etc/php-fpm.d/www.conf | ||
|
||
ENTRYPOINT [ "sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
|
||
XDEBUG_CONFIG=/etc/php/7.3/conf.d/00_xdebug | ||
XDEBUG_CONFIG=/etc/php7/conf.d/00_xdebug | ||
|
||
enable() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[unix_http_server] | ||
file=/dev/shm/supervisor.sock | ||
|
||
[supervisord] | ||
logfile=/tmp/supervisord.log | ||
logfile_maxbytes=50MB | ||
logfile_backups=10 | ||
loglevel=info | ||
pidfile=/tmp/supervisord.pid | ||
nodaemon=false | ||
minfds=1024 | ||
minprocs=200 | ||
user=root | ||
|
||
[rpcinterface:supervisor] | ||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | ||
|
||
[supervisorctl] | ||
serverurl=unix:///dev/shm/supervisor.sock | ||
|
||
[program:php-fpm] | ||
command=/usr/local/sbin/php-fpm -F | ||
autostart=true | ||
autorestart=true | ||
priority=1 | ||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 | ||
|
||
[program:nginx] | ||
command=/usr/sbin/nginx -g 'pid /tmp/nginx.pid; daemon off;' | ||
autostart=true | ||
autorestart=true | ||
priority=2 | ||
stdout_events_enabled=true | ||
stderr_events_enabled=true | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# Install dependencies. | ||
composer install | ||
|
||
# This /sbin/runit-wrapper has been copied from the base image phpearth/php:7.2-nginx | ||
# This is necessary to keep container in running state, otherwise container will | ||
# exit immediately after it's built. We need to keep it running to handle | ||
# incoming request. /sbin/runit-wrapper also handles SIGINT properly and | ||
# let system handle those signals appropriately. | ||
# see https://github.com/phpearth/docker-php/blob/master/docker/tags/nginx/sbin/runit-wrapper | ||
/sbin/runit-wrapper | ||
# Start supervisord. | ||
/usr/bin/supervisord -n -c /etc/supervisord.conf |