Docker image for running PHP apps in a single container with nginx and PHP-fpm
10K+
Docker image for running PHP apps in a single container with nginx and PHP-fpm
For basic usage with no further extensions, you just copy your sources to /app
FROM timoreymann/php-app
COPY --chown=application:application ./code /app
When you use composer for external dependencies you can easily install them in the build process.
The composer-install script downloads the installer from GitHub, installs the depencies and removes the phar file.
FROM timoreymann/php-app
WORKDIR /app
COPY --chown=application:application ./code ./
RUN composer-install
When you build a modern web app with PHP, chances are high that you will have routing within your index.php. To make it work, nginx needs to route all requests to the index.php, if the file does not exist in the webroot (e.g. assets).
FROM timoreymann/php-app
WORKDIR /app
COPY --chown=application:application ./code ./
RUN composer-install && configure-index-rewrite
The image consists of:
PHP 8 extensions that are common are also pre-installed:
I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:
To get started please read the Contribution Guidelines.
Content type
Image
Digest
sha256:afd770cde…
Size
31.4 MB
Last updated
6 months ago
docker pull timoreymann/php-app