|
|
|
|
|
|
|
FROM wordpress:6.4-apache |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
ENV WORDPRESS_DB_HOST=localhost |
|
ENV WORDPRESS_DB_NAME=wordpress |
|
ENV WORDPRESS_DB_USER=wordpress |
|
ENV WORDPRESS_DB_PASSWORD=wordpress |
|
ENV PYTHONUNBUFFERED=1 |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
sqlite3 \ |
|
libsqlite3-dev \ |
|
cron \ |
|
wget \ |
|
unzip \ |
|
python3 \ |
|
python3-pip \ |
|
curl \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN docker-php-ext-install pdo_sqlite \ |
|
&& docker-php-ext-enable pdo_sqlite |
|
|
|
|
|
RUN cd /tmp && \ |
|
wget https://downloads.wordpress.org/plugin/sqlite-database-integration.2.1.5.zip && \ |
|
unzip sqlite-database-integration.2.1.5.zip && \ |
|
mv sqlite-database-integration /usr/src/wordpress/wp-content/plugins/ && \ |
|
rm sqlite-database-integration.2.1.5.zip |
|
|
|
|
|
RUN mkdir -p /var/www/html/wp-content/database \ |
|
&& mkdir -p /var/log/wordpress \ |
|
&& mkdir -p /scripts |
|
|
|
|
|
COPY app.py /app/ |
|
COPY requirements.txt /app/ |
|
|
|
|
|
RUN pip3 install --no-cache-dir -r /app/requirements.txt |
|
|
|
|
|
COPY wp-config.php /usr/src/wordpress/ |
|
|
|
|
|
COPY monitor-cleanup.sh /scripts/ |
|
RUN chmod +x /scripts/monitor-cleanup.sh |
|
|
|
|
|
COPY start-services.sh /scripts/ |
|
RUN chmod +x /scripts/start-services.sh |
|
|
|
|
|
RUN echo "0 2 * * * /scripts/monitor-cleanup.sh >> /var/log/wordpress/cleanup.log 2>&1" | crontab - |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
RUN sed -i 's/Listen 80/Listen 7860/' /etc/apache2/ports.conf && \ |
|
sed -i 's/:80>/:7860>/' /etc/apache2/sites-available/000-default.conf |
|
|
|
|
|
WORKDIR /var/www/html |
|
|
|
|
|
CMD ["/scripts/start-services.sh"] |