checkvorteil/Dockerfile
2025-06-16 15:22:25 +02:00

45 lines
1.3 KiB
Docker

FROM wordpress:6.4-php8.2-apache
# Container Environment Variable
ENV WORDPRESS_CONTAINER=true
# Install additional PHP extensions and tools
RUN apt-get update && apt-get install -y \
libzip-dev \
unzip \
mariadb-client \
&& docker-php-ext-install zip \
&& rm -rf /var/lib/apt/lists/*
# Install WP-CLI
RUN curl -O https://raw.githubusercontent.com/wp-cli/wp-cli/master/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp
# Copy theme files
COPY . /usr/src/wordpress/wp-content/themes/checkvorteil/
# Set correct permissions for theme
RUN chown -R www-data:www-data /usr/src/wordpress/wp-content/themes/checkvorteil
# Copy Apache configuration (if exists)
COPY docker/apache-config.conf /etc/apache2/sites-available/000-default.conf
# Enable Apache modules
RUN a2enmod rewrite headers deflate expires
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost/?health=check || exit 1
# Copy and set up custom entrypoint
COPY docker/entrypoint.sh /usr/local/bin/custom-entrypoint.sh
RUN chmod +x /usr/local/bin/custom-entrypoint.sh
# Expose port
EXPOSE 80
# Use custom entrypoint
ENTRYPOINT ["/usr/local/bin/custom-entrypoint.sh"]
CMD ["apache2-foreground"]