From 4703557dbe229b3042917d5384a1a776ad9b3243 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Jun 2026 11:37:00 +0700 Subject: [PATCH] Add Dockerfile to root for deployment --- .dockerignore | 16 ++++++++++++++++ Dockerfile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..91e10cd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +01 +node_modules +npm-debug.log +.git +.gitignore +README.md +QUICK_START.md +.DS_Store +*.swp +*.swo +*~ +.vscode +.idea +docker-compose.yml +Dockerfile +.dockerignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9824748 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +# Use official PHP image with Apache +FROM php:8.1-apache + +# Set working directory +WORKDIR /var/www/html + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + mysql-client \ + git \ + curl \ + zip \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +# Enable Apache modules +RUN a2enmod rewrite \ + && a2enmod headers + +# Install PHP extensions +RUN docker-php-ext-install \ + mysqli \ + pdo \ + pdo_mysql + +# Set PHP configuration +RUN echo "display_errors = On" >> /usr/local/etc/php/conf.d/php.ini \ + && echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/php.ini \ + && echo "date.timezone = Asia/Jakarta" >> /usr/local/etc/php/conf.d/php.ini + +# Copy project files +COPY 01 /var/www/html + +# Set permissions +RUN chown -R www-data:www-data /var/www/html + +# Expose port 80 +EXPOSE 80 + +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ + CMD curl -f http://localhost/ || exit 1 + +# Start Apache +CMD ["apache2-foreground"]