-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 966 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM php:8.4-fpm
# System dependencies
RUN apt-get update && apt-get install -y \
git unzip libpng-dev libonig-dev libxml2-dev libzip-dev curl procps supervisor \
&& docker-php-ext-install pdo pdo_mysql zip
# Create Supervisor log directory
RUN mkdir -p /var/log/supervisor
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy Laravel backend code
COPY . .
# Install Laravel dependencies
RUN composer install --no-dev --optimize-autoloader
# Fix permissions for Laravel
RUN chown -R www-data:www-data /var/www/html/storage \
&& chown -R www-data:www-data /var/www/html/bootstrap/cache
# Copy Supervisor queue worker config
COPY ./docker/supervisor/laravel-worker.conf /etc/supervisor/conf.d/laravel-worker.conf
COPY ./docker/supervisor/php-fpm.conf /etc/supervisor/conf.d/php-fpm.conf
# Start Supervisor instead of php-fpm directly
CMD ["/usr/bin/supervisord", "-n"]