Files
flixcooks-website/Dockerfile
T

38 lines
1.3 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# FlixCooks Production image (Coolify / any Docker host)
FROM php:8.3-apache-bookworm
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev \
&& docker-php-ext-install pdo_pgsql \
&& a2enmod rewrite headers \
&& rm -rf /var/lib/apt/lists/*
# Apache: document root + AllowOverride for .htaccess
ENV APACHE_DOCUMENT_ROOT=/var/www/html
RUN sed -ri 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \
&& printf '%s\n' \
'<Directory /var/www/html>' \
' AllowOverride All' \
' Require all granted' \
'</Directory>' \
> /etc/apache2/conf-available/flixcooks.conf \
&& a2enconf flixcooks
WORKDIR /var/www/html
COPY --chown=www-data:www-data . /var/www/html
RUN sed -i 's/\r$//' /var/www/html/docker/entrypoint.sh \
&& chmod +x /var/www/html/docker/entrypoint.sh \
&& mkdir -p /var/www/html/data \
&& chown -R www-data:www-data /var/www/html/data
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=40s --retries=3 \
CMD php /var/www/html/health.php >/dev/null || exit 1
ENTRYPOINT ["/var/www/html/docker/entrypoint.sh"]
CMD ["apache2-foreground"]