php, nginx, init script, cron, debian buster
7.2K
phusion lemp server uses runit for a tiny supervisor.
phusion lemp server uses Debian Buster for compatibility with MSSQL drivers.
phusion lemp server separates build tools into a separate image for your CI pipeline.
Official PHP docker image combined with phusion/baseimage to get cron, syslog, runit, and nginx
| PHP Version - flavor | 7.3.26-{db} | 7.3.26-builder |
|---|---|---|
| BCMATH | X | X |
| Intl | X | X |
| gd | X | X |
| mysql | X | X |
| pgsql | o | X |
| mssql | o | X |
| sqlite3 | X | X |
| readline | X | X |
| memcached (igbinary) | X | X |
| xdebug | X | X |
| zip | X | X |
| SOAP | X | X |
| SSH2 | X | X |
| pcntl | X | X |
| nginx | X | X |
| yarn | X | |
| nodejs | X | |
| composer2 | X | |
| composer1.10 | X | |
| deployer | X | |
| altax | X | |
| git | X |
You can install extension just like the "official" php docker container
FROM markkimsal/phuion-lemp:7.3.20-fpm-buster
RUN docker-php-ext-install mysqli pdo_mysql \
&& docker-php-ext-enable mysqli pdo_mysql
Pass PHP requests to localhost 9000. This assumes everything is copied or mounted to /app
map $http_x_forwarded_proto $fastcgi_param_https_variable {
default '';
https 'on';
}
server {
listen 0.0.0.0:8080 default;
server_name _;
root /app/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
#try_files $uri $uri/index.php;
}
location ~ \.php$ {
fastcgi_pass localhost:9000;
include fastcgi.conf;
fastcgi_index /index.php;
fastcgi_param HTTPS $fastcgi_param_https_variable;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
Docker-compose example
services:
webapp:
tty: true
build:
context: ./
dockerfile: ci/dockerfile-phpfpm
ports:
- 8080:8080
volumes:
- .:/app
- ./config/container-nginx.vhost.conf:/etc/nginx/conf.d/container-vhost.conf
Mssql gives .deb packages for installing ODBC and sqlsrv extension on PHP. This means you need Debian/Ubuntu instead of alpine.
FROM markkimsal/php-nginx-phusion:7.3-fpm
# Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
RUN apt-get update \
&& apt-get install -y apt-utils gnupg curl build-essential libaio1 software-properties-common locales iputils-ping --no-install-recommends \
&& apt-get install -y \
apt-transport-https \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update
# Install Dependencies
RUN ACCEPT_EULA=Y apt-get install -y \
unixodbc \
unixodbc-dev \
libgss3 \
odbcinst \
msodbcsql17 \
locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
# Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
RUN pecl install pdo_sqlsrv sqlsrv \
&& docker-php-ext-enable pdo_sqlsrv sqlsrv
Content type
Image
Digest
Size
117.1 MB
Last updated
over 4 years ago
docker pull markkimsal/phusion-lemp:7.3-mssql