d13f744aea
New features: - Docker support (Dockerfile + docker-compose.yml) - GitHub Actions CI pipeline (PHP lint, JS lint, Docker build, i18n validation) - Internationalization system with 3 languages (it, en, de) and 347 translation keys - First-run setup wizard (4-step configuration) - File-based API rate limiting (120/15/5 req/min tiers) - OpenAPI 3.1.0 specification for all 43 API endpoints - CONTRIBUTING.md with translation and development guide - Screenshots directory placeholder Modified: - README.md: Docker badges, install instructions, translations section - api/index.php: rate limiting middleware - assets/js/app.js: i18n system, setup wizard, t() function - assets/css/style.css: setup wizard styles - index.html: data-i18n attributes, setup wizard overlay, language settings - .gitignore: rate_limits exclusion
42 lines
1.1 KiB
Docker
42 lines
1.1 KiB
Docker
FROM php:8.2-apache
|
|
|
|
# Install required PHP extensions
|
|
RUN apt-get update && apt-get install -y \
|
|
libsqlite3-dev \
|
|
libcurl4-openssl-dev \
|
|
&& docker-php-ext-install pdo_sqlite curl mbstring \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Enable Apache mod_rewrite
|
|
RUN a2enmod rewrite
|
|
|
|
# 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
|
|
|
|
# Apache configuration: serve from app root
|
|
RUN echo '<Directory /var/www/html>\n\
|
|
AllowOverride All\n\
|
|
Require all granted\n\
|
|
</Directory>' > /etc/apache2/conf-available/dispensa.conf \
|
|
&& a2enconf dispensa
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
|
CMD curl -f http://localhost/ || exit 1
|
|
|
|
CMD ["apache2-foreground"]
|