FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0 ARG http_proxy ARG https_proxy ENV http_proxy=${http_proxy} ENV https_proxy=${https_proxy} ENV HTTP_PROXY=${http_proxy} ENV HTTPS_PROXY=${https_proxy} # ========================================================= # System dependencies & Extensions # ========================================================= RUN echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye main" > /etc/apt/sources.list \ && echo "deb [trusted=yes] http://10.15.39.186:8081/repository/debian-proxy/ bullseye-updates main" >> /etc/apt/sources.list \ && rm -rf /etc/apt/sources.list.d/* \ && apt-get update \ && apt-get install -y --no-install-recommends \ nginx \ redis-server \ procps \ vim \ wget \ curl \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ libzip-dev \ libaio1 \ libaio-dev \ unzip \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install gd pdo pdo_mysql zip \ && curl --noproxy "*" -fsSL http://10.15.39.186:8081/repository/raw-assets/storage/app/uploads/redis-5.3.7.tgz -o redis.tgz \ && pecl install redis.tgz \ && docker-php-ext-enable redis \ && rm -f redis.tgz \ && rm -rf /var/lib/apt/lists/* WORKDIR /var/www/html # Salin source code aplikasi COPY . /var/www/html # Buat file .env dari .env.example jika .env belum ada di repositori RUN if [ ! -f .env ]; then \ if [ -f .env.example ]; then \ cp .env.example .env; \ else \ echo "APP_NAME=Sidata\nAPP_ENV=production\nAPP_KEY=\nAPP_DEBUG=true\nAPP_URL=https://dashboard-bpkd.drc-bpkd.data-center.id/sidata" > .env; \ fi \ fi # Atur hak akses folder web, storage, dan cache Laravel RUN chown -R www-data:www-data /var/www/html \ && chmod -R 775 /var/www/html/storage \ && chmod -R 775 /var/www/html/bootstrap/cache # Konfigurasi Nginx presisi untuk subpath /sidata dan PHP-FPM RUN echo 'server { \ listen 80; \ index index.php index.html; \ root /var/www/html/public; \ \ location /sidata { \ try_files $uri $uri/ /sidata/index.php?$query_string; \ } \ \ location / { \ try_files $uri $uri/ /index.php?$query_string; \ } \ \ location ~ \.php$ { \ fastcgi_pass 127.0.0.1:9000; \ fastcgi_index index.php; \ include fastcgi_params; \ fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php; \ fastcgi_param SCRIPT_NAME $fastcgi_script_name; \ } \ }' > /etc/nginx/sites-available/default EXPOSE 80 CMD ["sh", "-c", "redis-server --daemonize yes && php-fpm -D && exec nginx -g 'daemon off;'"]