# Gunakan base image PHP 7.4 FPM dari registry lokal
FROM docker.rri.co.id/php74-fpm:latest

# Informasi maintainer (optional)
LABEL maintainer="direktorat_tmb@rri.co.id"
LABEL app="CI3 CSIRT Application"

# Install PHP Extension yang dibutuhkan
RUN docker-php-ext-install mysqli pdo pdo_mysql

# Copy seluruh isi aplikasi CodeIgniter ke dalam container
WORKDIR /var/www/website_csirt
COPY . /var/www/website_csirt

# Ganti ownership supaya webserver bisa akses
RUN chown -R www-data:www-data /var/www/website_csirt

# Set permission directory (opsional kalau mau lebih keras security-nya)
RUN find /var/www/website_csirt -type d -exec chmod 755 {} \; && \
    find /var/www/website_csirt -type f -exec chmod 644 {} \;

# Expose port PHP-FPM
EXPOSE 9000

# Start PHP-FPM process
CMD ["php-fpm"]
