Sign inSign up

kalicki2k/alpine-apache-php

By kalicki2k

•Updated over 3 years ago

Apache + PHP container

Image
1

2.6K

kalicki2k/alpine-apache-php repository overview

⁠Apache with PHP on Alpine Linux

This is a docker images with Apache and PHP / Composer based on Alpine Linux.

To access site contents from outside the container you should map /var/www/localhost/htdocs.

Includes composer for easy download of php libraries.

⁠Static folders

The image exposes a volume at /var/www/localhost. The structure is:

DirectoryDescription
/var/www/localhost/htdocsweb root
/var/www/localhost/cgi-bincgi bin folder
/var/www/localhost/logslog folder
/var/www/localhost/errorerror pages

⁠Environment variables

Various env vars can be set at runtime via your docker command or docker-compose environment section.

⁠Apache
NameDescription
APACHE_SERVER_NAMEServer name that the server uses to identify itself.
APACHE_SERVER_MAILYour address, where problems with the server should be e-mailed
APACHE_RUN_USERUser name to run httpd as.
APACHE_RUN_USER_IDUser ID to run httpd as.
APACHE_RUN_GROUPGroup name to run httpd as.
APACHE_RUN_GROUP_IDGroup ID to run httpd as.
APACHE_SSL_CERTIFICATEServer Certificate...
APACHE_SSL_CERTIFICATE_KEYServer Private Key...
APACHE_SSL_CERTIFICATE_CHAINServer Certificate Chain...
APACHE_WEB_ROOT
⁠PHP
NameDefaultDescription
PHP_SHORT_OPEN_TAGOffTells PHP whether the short form <? ?> of PHP's open tag should be allowed. (See: http://php.net/short-open-tag⁠)
PHP_OUTPUT_BUFFERING4096You can enable output buffering for all files by setting this directive to 'On'. If you wish to limit the size of the buffer to a certain size - you can use a maximum number of bytes instead of 'On', as a value for this directive. (See: http://php.net/output-buffering⁠)
PHP_OPEN_BASEDIRLimit the files that can be accessed by PHP to the specified directory-tree, including the file itself. (See: http://php.net/open-basedir⁠)
PHP_MAX_EXECUTION_TIME30This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. (See: http://php.net/max-execution-time⁠)
PHP_MAX_INPUT_TIME60This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. (See: http://php.net/max-input-time⁠)
PHP_MAX_INPUT_VARS1000How many input variables may be accepted (limit is applied to $_GET, $_POST and $_COOKIE superglobal separately). (See: http://php.net/manual/en/info.configuration.php#ini.max-input-vars⁠)
PHP_MEMORY_LIMIT128MThis sets the maximum amount of memory in bytes that a script is allowed to allocate. (See: http://php.net/memory-limit⁠)
PHP_ERROR_REPORTINGE_ALL & ~E_DEPRECATED & ~E_STRICTSet the error reporting level. (See: http://php.net/error-reporting⁠)
PHP_DISPLAY_ERRORSOffThis determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user. (See: http://php.net/display-errors⁠)
PHP_DISPLAY_STARTUP_ERRORSOffEven when display_errors is on, errors that occur during PHP's startup sequence are not displayed. (See: http://php.net/display-startup-errors⁠)
PHP_LOG_ERRORSOnTells whether script error messages should be logged to the server's error log. (See: http://php.net/log-errors⁠)
PHP_LOG_ERRORS_MAX_LEN1024Set the maximum length of log_errors in bytes. (See: http://php.net/log-errors-max-len⁠)
PHP_IGNORE_REPEATED_ERRORSOffDo not log repeated messages. (See: http://php.net/ignore-repeated-errors⁠)
PHP_REPORT_MEMLEAKSOnThis parameter will show a report of memory leaks detected by the Zend memory manager. (See: http://php.net/report-memleaks⁠)
PHP_HTML_ERRORSOnIf enabled, error messages will include HTML tags. (See: http://php.net/html-errors⁠)
PHP_ERROR_LOGName of the file where script errors should be logged. (See: http://php.net/error-log⁠)
PHP_POST_MAX_SIZE8MSets max size of post data allowed. (See: http://php.net/post-max-size⁠)
PHP_DEFAULT_MIMETYPEtext/htmlBy default, PHP will output a media type using the Content-Type header. (See: http://php.net/default-mimetype⁠)
PHP_DEFAULT_CHARSETUTF-8Default character encoding... (See: http://php.net/default-charset⁠)
PHP_FILE_UPLOADSOnWhether to allow HTTP file uploads. (See: http://php.net/file-uploads⁠)
PHP_UPLOAD_TMP_DIRThe temporary directory used for storing files when doing file upload. (See: http://php.net/upload-tmp-dir⁠)
PHP_UPLOAD_MAX_FILESIZE2MThe maximum size of an uploaded file. (See: http://php.net/upload-max-filesize⁠)
PHP_ALLOW_URL_FOPENOnThis option enables the URL-aware fopen wrappers that enable accessing URL object like files. (See: http://php.net/allow-url-fopen⁠)
PHP_ALLOW_URL_INCLUDEOffThis option allows the use of URL-aware fopen wrappers with the following functions: include, include_once, require, require_once. (See: http://php.net/allow-url-include⁠)
PHP_DEFAULT_SOCKET_TIMEOUT60Default timeout (in seconds) for socket based streams. (See: http://php.net/default-socket-timeout⁠)
PHP_DATE_TIMEZONEEurope/BerlinDefines the default timezone used by the date functions. (See: http://php.net/date.timezone⁠)
PHP_PDO_MYSQL_CACHE_SIZE2000If mysqlnd is used: Number of cache slots for the internal result set cache. (See: http://php.net/pdo_mysql.cache_size⁠)
PHP_PDO_MYSQL_DEFAULT_SOCKETDefault socket name for local MySQL connects. (See: http://php.net/pdo_mysql.default-socket⁠)
PHP_SESSION_SAVE_HANDLERfilesHandler used to store/retrieve data. (See: http://php.net/session.save-handler⁠)
PHP_SESSION_SAVE_PATH/tmpIn the case of files, this is the path where data files are stored. (See: http://php.net/session.save-path⁠)
PHP_SESSION_USE_STRICT_MODE0Whether to use strict session mode. (See: https://wiki.php.net/rfc/strict_sessions⁠)
PHP_SESSION_USE_COOKIES1Whether to use cookies. (See: http://php.net/session.use-cookies⁠)
PHP_SESSION_COOKIE_SECURESpecifies whether cookies should only be sent over secure connections. (See: http://php.net/session.cookie-secure⁠)
PHP_SESSION_NAMEPHPSESSIDName of the session (used as cookie name). (See: http://php.net/session.name⁠)
PHP_SESSION_COOKIE_LIFETIME0Lifetime in seconds of cookie or, if 0, until browser is restarted. (See: http://php.net/session.cookie-lifetime⁠)
PHP_SESSION_COOKIE_PATH/The path for which the cookie is valid. (See: http://php.net/session.cookie-path⁠)
PHP_SESSION_COOKIE_DOMAINThe domain for which the cookie is valid. (See: http://php.net/session.cookie-domain⁠)
PHP_SESSION_COOKIE_HTTPONLYWhether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. (See: http://php.net/session.cookie-httponly⁠)
⁠Additional environment variables
NameDefaultDescription
PUBLIC_DIRECTORYThe public directory contains the index.php file, which is the entry point for all requests entering your application.

⁠Examples

  • plain, accessible on port 8080 docker run -d -p 8080:80 kalicki2k/alpine-apache-php:7.2
  • with external contents in /home/kalicki2k/html docker run -d -p 8080:80 -v /home/kalicki2k/html:/var/www/localhost kalicki2k/alpine-apache-php:7.2

The docker container is started with the -d flag so it will run into the background. To run commands or edit settings inside the container run `docker exec -ti /bin/bash'

Tag summary

Content type

Image

Digest

sha256:e32401fab…

Size

53.7 MB

Last updated

over 3 years ago

docker pull kalicki2k/alpine-apache-php