automaatio/php

By automaatio

Updated 6 months ago

PHP image for docker which includes PDO packages

Image
Languages & Frameworks
0

8

Overview

This image is based on the PHP 7.4.30 Docker image from Apache. It adds Python packages which are needed to connect to a MySQL database via PDO.


Dockerfile

################################################################
### Base Image
################################################################

# Apache PHP 7.4.30 - No Log4J Vulnerability
FROM php:7.4.30-apache


################################################################
### Packages
################################################################

# Add MySQLi, PDO, and PDO_MYSQL packages
RUN docker-php-ext-install mysqli pdo pdo_mysql

Docker Compose

# Docker-Compose Version
version: "3.8"

################################################
# Services
################################################

services:

  ################################################
  # PHP
  ################################################

  php:
    image: "automaatio/php:7.4.30-apache"
    container_name: "php"
    restart: unless-stopped
    environment:
      TZ: ${TZ}
    ports:
      - "80:80"
    expose:
      - "80"
    volumes:
      - "/home/docker/php:/var/www/html/"

Docker Pull Command

docker pull automaatio/php