phpcontainer/Dockerfile

52 lines
1.7 KiB
Docker
Raw Normal View History

2023-08-23 16:23:17 +00:00
########################################################################################################################################
# Documentation: https://git.nickyeoman.com/4lt/phpcontainer/wiki
########################################################################################################################################
FROM php:8.2.9-apache
LABEL maintainer="4 Lights Consulting <info@4lt.ca>"
LABEL description="Production-ready PHP Apache container"
LABEL version="1"
LABEL org.label-schema.vcs-url="https://git.nickyeoman.com/4lt/phpcontainer"
# Setup
WORKDIR /website
ENV APACHE_DOCUMENT_ROOT /website/public/
# APT
RUN apt-get update
# IMAP
RUN apt-get install -y libc-client-dev libkrb5-dev libssl-dev;
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl
RUN docker-php-ext-install imap
# Symfony
RUN apt-get install -y libicu-dev
RUN docker-php-ext-configure intl
RUN docker-php-ext-install intl
2023-08-23 19:55:00 +00:00
# GD and ZIP Extensions
RUN apt-get install -y libpng-dev libjpeg-dev libfreetype6-dev libzip-dev
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install gd
RUN docker-php-ext-install zip
2023-08-23 16:23:17 +00:00
# Cleanup
RUN rm -r /var/lib/apt/lists/*
# Apache settings
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN a2enmod expires headers rewrite socache_shmcb ssl
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN docker-php-ext-install opcache
# Docker config
EXPOSE 80
CMD ["apache2-foreground"]