50 lines
1.8 KiB
Docker
50 lines
1.8 KiB
Docker
FROM 10.15.39.186:8083/php74-fpm-oci8-lengkap:1.0
|
|
|
|
# Arahkan repository APT ke Nexus Debian Proxy lokal
|
|
RUN sed -i 's|http://deb.debian.org/debian|http://10.15.39.186:8081/repository/debian-proxy|g' /etc/apt/sources.list \
|
|
&& sed -i 's|http://security.debian.org/debian-security|http://10.15.39.186:8081/repository/debian-proxy|g' /etc/apt/sources.list \
|
|
&& sed -i 's|http://security.debian.org|http://10.15.39.186:8081/repository/debian-proxy|g' /etc/apt/sources.list 2>/dev/null || true
|
|
|
|
# Install Nginx dan dependensi kompilasi
|
|
RUN apt-get update && apt-get install -y \
|
|
nginx \
|
|
curl \
|
|
autoconf \
|
|
g++ \
|
|
make \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Unduh dan pasang ekstensi PHP Redis dari repository Nexus
|
|
RUN curl -o /tmp/redis-5.3.7.tgz http://10.15.39.186:8081/repository/raw-assets/storage/app/uploads/redis-5.3.7.tgz \
|
|
&& pecl install /tmp/redis-5.3.7.tgz \
|
|
&& docker-php-ext-enable redis \
|
|
&& rm -f /tmp/redis-5.3.7.tgz
|
|
|
|
WORKDIR /var/www/html
|
|
|
|
# Salin source code aplikasi
|
|
COPY . /var/www/html
|
|
|
|
# Atur hak akses folder storage dan cache Laravel
|
|
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache \
|
|
&& chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
|
|
|
|
# Konfigurasi Nginx
|
|
RUN echo 'server { \
|
|
listen 80; \
|
|
index index.php index.html; \
|
|
root /var/www/html/public; \
|
|
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 $document_root$fastcgi_script_name; \
|
|
} \
|
|
}' > /etc/nginx/sites-available/default
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["sh", "-c", "php-fpm -D && nginx -g 'daemon off;'"] |