Edit Dockerfile
This commit is contained in:
+27
-16
@@ -9,15 +9,34 @@ ARG https_proxy
|
|||||||
ENV http_proxy=$http_proxy
|
ENV http_proxy=$http_proxy
|
||||||
ENV https_proxy=$https_proxy
|
ENV https_proxy=$https_proxy
|
||||||
|
|
||||||
# Install Nginx & Dependencies
|
RUN apt-get update && apt-get install -y \
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
||||||
vim \
|
vim \
|
||||||
nginx \
|
alien \
|
||||||
unzip \
|
wget \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
libpng-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libzip-dev \
|
||||||
|
libaio1 \
|
||||||
|
libaio-dev \
|
||||||
|
zip \
|
||||||
|
git \
|
||||||
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
|
&& docker-php-ext-install gd pdo pdo_mysql zip
|
||||||
|
|
||||||
# Salin Composer binary dari registry lokal jika sewaktu-waktu butuh dump-autoload
|
RUN wget https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-basic-19.19.0.0.0-1.el9.x86_64.rpm && \
|
||||||
COPY --from=10.15.39.186:8084/library/composer:2.7 /usr/bin/composer /usr/bin/composer
|
wget https://download.oracle.com/otn_software/linux/instantclient/1919000/oracle-instantclient19.19-devel-19.19.0.0.0-1.el9.x86_64.rpm && \
|
||||||
|
alien -i oracle-instantclient19.19-*.rpm && \
|
||||||
|
rm oracle-instantclient19.19-*.rpm
|
||||||
|
|
||||||
|
RUN pear config-set http_proxy "http://10.15.3.20:80" && export PHP_DTRACE=yes
|
||||||
|
|
||||||
|
# Install ekstensi OCI8
|
||||||
|
RUN pecl channel-update pecl.php.net && C_INCLUDE_PATH=/usr/include/oracle/19.19/client64 pecl install oci8-2.2.0 && \
|
||||||
|
echo "extension=oci8.so" > /usr/local/etc/php/conf.d/oci8.ini
|
||||||
|
|
||||||
|
# Install Composer
|
||||||
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
|
|
||||||
@@ -25,11 +44,7 @@ WORKDIR /var/www
|
|||||||
# tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod
|
# tetapi tambahkan flag chown untuk mencegah error Permission Denied (Error 500) pada Pod
|
||||||
COPY --chown=www-data:www-data . .
|
COPY --chown=www-data:www-data . .
|
||||||
|
|
||||||
RUN composer install \
|
RUN composer install
|
||||||
--no-dev \
|
|
||||||
--prefer-dist \
|
|
||||||
--no-interaction \
|
|
||||||
--optimize-autoloader
|
|
||||||
|
|
||||||
# Hapus proxy dari environment runtime
|
# Hapus proxy dari environment runtime
|
||||||
#ENV http_proxy=
|
#ENV http_proxy=
|
||||||
@@ -73,10 +88,6 @@ RUN mkdir -p \
|
|||||||
# Bersihkan cache konfigurasi lama agar tidak menyebabkan error 500 saat pod dinyalakan
|
# Bersihkan cache konfigurasi lama agar tidak menyebabkan error 500 saat pod dinyalakan
|
||||||
RUN php /var/www/artisan config:clear || true
|
RUN php /var/www/artisan config:clear || true
|
||||||
|
|
||||||
ENV APP_ENV=production
|
|
||||||
ENV APP_DEBUG=false
|
|
||||||
ENV DB_CONNECTION=dejos
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["sh", "-c", "php-fpm -D && exec nginx -g 'daemon off;'"]
|
CMD ["sh", "-c", "php-fpm -D && exec nginx -g 'daemon off;'"]
|
||||||
|
|||||||
Reference in New Issue
Block a user