Hallo Leute, ich möchte gerne in meinem Dockerfile für PHP auch Sendmail integerieren.
Ich möchte die Mailfunktion so nutzen wie ich sie bei einer Xampp Installation nutzen kann, direkt ab Werk ohne irgendwelche SMTP Einstellungen oder sonstiges,
ich hoffe Ihr könnt mir helfen, ich hab jetzt echt schon viel probiert
Mein aktuelles Dockerfile ist folgendermaßen aufgebaut
Danke schon mal im voraus.
LG
Jonny
Ich möchte die Mailfunktion so nutzen wie ich sie bei einer Xampp Installation nutzen kann, direkt ab Werk ohne irgendwelche SMTP Einstellungen oder sonstiges,
ich hoffe Ihr könnt mir helfen, ich hab jetzt echt schon viel probiert
Mein aktuelles Dockerfile ist folgendermaßen aufgebaut
Code:
FROM php:7.1-apache
# # Install dependencies
FROM php:7.1-apache
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
libpq-dev \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl \
sshpass \
mariadb-client \
jq \
gettext-base \
libssl-dev \
zlib1g-dev libzip-dev sendmail \
sendmail-cf \
m4 \
procmail
# # Install extensions
RUN docker-php-ext-install gd
# # Install Postgre PDO
RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install pdo pdo_pgsql pgsql
# # Install Mysql PDO
RUN docker-php-ext-install mysqli pdo pdo_mysql \
&& docker-php-ext-enable pdo_mysql
RUN docker-php-ext-install zip
# Configure Sendmail
# Create sendmail configuration for PHP
RUN echo "sendmail_path=/usr/sbin/sendmail -t -i" >> /usr/local/etc/php/conf.d/sendmail.ini
# Add default gateway IP and hostname to hosts file
RUN sed -i '/#!\/bin\/sh/aservice sendmail restart' /usr/local/bin/docker-php-entrypoint
RUN sed -i '/#!\/bin\/sh/aecho "$(hostname -i)\t$(hostname) $(hostname).localhost" >> /etc/hosts' /usr/local/bin/docker-php-entrypoint
# Expose sendmail daemon
EXPOSE 25
RUN apt-get update -y \
&& apt-get install -y \
libxml2-dev \
&& apt-get clean -y \
&& docker-php-ext-install soap
# Installieren von Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
&& php -r "unlink('composer-setup.php');"
# Installieren Sie notwendige Pakete
RUN apt-get update \
&& apt-get install -y openssl \
&& rm -rf /var/lib/apt/lists/*
# Erstellen Sie ein selbstsigniertes Zertifikat
RUN openssl genrsa -out /etc/ssl/private/mykey.key 2048 \
&& openssl req -new -key /etc/ssl/private/mykey.key -out /etc/ssl/certs/mycsr.csr -subj "/C=DE/ST=YourState/L=YourCity/O=YourOrganization/OU=YourUnit/CN=yourdomain.com" \
&& openssl x509 -req -days 365 -in /etc/ssl/certs/mycsr.csr -signkey /etc/ssl/private/mykey.key -out /etc/ssl/certs/mycert.crt \
&& rm /etc/ssl/certs/mycsr.csr
# Aktivieren Sie Apache-Module
RUN a2enmod ssl
RUN a2enmod rewrite
# Setzen Sie das Apache Document Root auf das Laravel public Verzeichnis
ENV APACHE_DOCUMENT_ROOT /var/www/html
EXPOSE 80
EXPOSE 443
Danke schon mal im voraus.
LG
Jonny