Files
EverShelf/Dockerfile
T
morgane bcecc2430d
CI / PHP Syntax Check (push) Waiting to run
CI / JavaScript Lint (push) Waiting to run
CI / Docker Build Test (push) Waiting to run
CI / Validate Translation Files (push) Waiting to run
CI / Auto-merge develop → main (push) Blocked by required conditions
CI / Create GitHub Release (push) Blocked by required conditions
Security Scan (Trivy) / Trivy — Docker image scan (push) Waiting to run
Security Scan (Trivy) / Trivy — Filesystem scan (push) Waiting to run
Actualiser Dockerfile
2026-06-30 11:37:51 +00:00

51 lines
1.6 KiB
Docker

FROM php:8.2-apache-bookworm
# Install required PHP extensions + Tesseract OCR for offline expiry date reading
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
libsqlite3-dev \
libcurl4-openssl-dev \
libonig-dev \
libgd-dev \
libzip-dev \
libicu-dev \
tesseract-ocr \
tesseract-ocr-ita \
tesseract-ocr-eng \
&& docker-php-ext-install pdo_sqlite curl mbstring gd zip intl \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Enable Apache mod_rewrite and mod_headers
RUN a2enmod rewrite headers
# Set working directory
WORKDIR /var/www/html
# Copy application files
COPY . /var/www/html/
# Create data directory with proper permissions
RUN mkdir -p /var/www/html/data/backups \
&& chown -R www-data:www-data /var/www/html/data \
&& chmod -R 775 /var/www/html/data
# Create .env from example if it doesn't exist (will be overridden by volume mount)
RUN [ ! -f /var/www/html/.env ] && cp /var/www/html/.env.example /var/www/html/.env || true
RUN chown www-data:www-data /var/www/html/.env && chmod 664 /var/www/html/.env
# Apache configuration: serve from app root
RUN echo '<Directory /var/www/html>\n\
AllowOverride All\n\
Require all granted\n\
</Directory>\n\
# Traefik / reverse-proxy: treat forwarded HTTPS as on so .htaccess does not redirect-loop\n\
SetEnvIf X-Forwarded-Proto "https" HTTPS=on' > /etc/apache2/conf-available/evershelf.conf \
&& a2enconf evershelf
# Expose port 80
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -f http://localhost/ || exit 1
CMD ["apache2-foreground"]