Combined PHP and nginx container
3.1K
Base images are based on the official php-fpm images based on Debian Stretch (7.2-stretch, 7.3-stretch) and Buster (7.2, 7.3, 7.4).
Simply create a Dockerfile in your php application. Something similar to the following.
FROM clivewalkden/php-nginx:7.4
# Copy in nginx config and vhost conf
COPY ./.docker/nginx.conf /etc/nginx/nginx.conf
COPY ./.docker/nginx-site.conf /etc/nginx/conf.d/default.conf
# Copy your php application into the image
WORKDIR /var/www/app
COPY --chown=www-data:www-data . /var/www/app/
# (Optional) Composer install
RUN composer install --no-scripts --no-autoloader --ansi --no-interaction
# Expose the relevant ports
EXPOSE 80 443 9000 9001
# Start supervisor to bring up php-fpm and nginx in the same container
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
Content type
Image
Digest
Size
180.9 MB
Last updated
over 5 years ago
docker pull clivewalkden/php-nginx