# Use a lightweight base image
FROM centos:7
# Set environment variables
ENV PMTA_VERSION=5.x.x
ENV PMTA_LICENSE_KEY=your_license_key_here
# Install required dependencies
RUN yum -y update && \
yum -y install wget tar && \
yum clean all
# Add PowerMTA package
ADD https://your-pmta-download-url/pmta-$PMTA_VERSION.tar.gz /tmp/
# Install PowerMTA
RUN tar -xvzf /tmp/pmta-$PMTA_VERSION.tar.gz -C /tmp && \
cd /tmp/pmta-$PMTA_VERSION && \
./install.sh && \
rm -rf /tmp/pmta*
# Copy your custom configuration files
COPY pmta/config/ /etc/pmta/
# Expose necessary ports
EXPOSE 25 587 8080
# Define volumes for persistent data
VOLUME ["/var/spool/pmta", "/var/log/pmta"]
# Start PowerMTA
CMD ["/etc/init.d/pmta", "start"]