This commit is contained in:
parent
48423687c2
commit
d3831fd510
@ -23,7 +23,6 @@ WORKDIR /var/www
|
|||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY .env.example .env
|
|
||||||
|
|
||||||
# Install Laravel dependencies
|
# Install Laravel dependencies
|
||||||
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
|
||||||
@ -39,5 +38,11 @@ RUN chown -R www-data:www-data /var/www \
|
|||||||
&& chmod -R 775 storage bootstrap/cache \
|
&& chmod -R 775 storage bootstrap/cache \
|
||||||
&& chown -R www-data:www-data storage bootstrap/cache
|
&& chown -R www-data:www-data storage bootstrap/cache
|
||||||
|
|
||||||
|
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
CMD ["php-fpm"]
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
14
entrypoint.sh
Normal file
14
entrypoint.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Salin .env jika belum ada
|
||||||
|
if [ ! -f .env ]; then
|
||||||
|
cp .env.example .env
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set ownership dan permission untuk Laravel
|
||||||
|
chown -R www-data:www-data /var/www
|
||||||
|
chmod -R 775 /var/www/storage /var/www/bootstrap/cache
|
||||||
|
chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
|
||||||
|
|
||||||
|
# Jalankan php-fpm
|
||||||
|
exec php-fpm
|
||||||
Loading…
x
Reference in New Issue
Block a user