aboutsummaryrefslogtreecommitdiffstats
path: root/docker/php/Dockerfile
blob: 375e3a702ab96ad8d4651030f22866282c5a4347 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM php:8.5.4-fpm

# Install system libs for GD (PNG + JPEG) and a mail agent, then compile PHP extensions
RUN apt-get update && apt-get install -y \
    libpng-dev \
    libjpeg62-turbo-dev \
    msmtp \
    && docker-php-ext-configure gd --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd pdo_mysql \
    && rm -rf /var/lib/apt/lists/*

# Tell PHP to use msmtp as sendmail, and configure msmtp to relay through mailpit
RUN echo "sendmail_path = /usr/bin/msmtp -t" > /usr/local/etc/php/conf.d/mail.ini

RUN echo "account default\n\
host mailpit\n\
port 1025\n\
from noreply@camagru.local\n\
auth off\n\
tls off" > /etc/msmtprc

RUN echo "upload_max_filesize = 10M" > /usr/local/etc/php/conf.d/uploads.ini \
    && echo "post_max_size = 10M" >> /usr/local/etc/php/conf.d/uploads.ini

WORKDIR /var/www/html