@@ -23,25 +23,28 @@ COPY resources/img ./resources/img
23
23
RUN npm run production
24
24
25
25
# Stage 2: Setup PHP Application Environment
26
- FROM ric_harvey/nginx- php-fpm:3.1.6 AS app
26
+ FROM webdevops/ php-nginx:8.2-alpine AS app
27
27
28
28
# Set working directory
29
+ # The webdevops images often use /app as the default document root for Nginx.
30
+ # We will set our application root to /var/www/html and ensure Nginx config reflects this.
29
31
WORKDIR /var/www/html
30
32
31
33
# Install system dependencies and PHP extensions
32
- # The ric_harvey/nginx-php-fpm image should have most common extensions .
33
- # We'll add pdo_mysql, gd, zip, bcmath, exif, opcache, intl if they are not present .
34
- # This often requires root access, then dropping back to www-data .
35
- # The exact commands depend on the base image's package manager (apk for Alpine) .
34
+ # webdevops images are comprehensive. Many extensions are pre-installed or can be enabled via env vars .
35
+ # We'll ensure pdo_mysql, gd, zip, bcmath, exif, opcache, intl are available .
36
+ # The `docker-php-ext-install` approach should still work for missing extensions .
37
+ # $PHPIZE_DEPS are build dependencies for compiling extensions .
36
38
USER root
37
- RUN apk add --no-cache \
39
+ RUN apk add --no-cache --virtual .build-deps \
40
+ $PHPIZE_DEPS \
38
41
libzip-dev \
39
42
libpng-dev \
40
- libjpeg-turbo -dev \
43
+ jpeg -dev \
41
44
freetype-dev \
42
45
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
43
46
&& docker-php-ext-install -j$(nproc) gd pdo_mysql zip bcmath exif opcache intl \
44
- && apk del libzip-dev libpng-dev libjpeg-turbo-dev freetype-dev \
47
+ && apk del .build-deps \
45
48
&& rm -rf /var/cache/apk/*
46
49
47
50
# Install Composer globally
@@ -60,10 +63,11 @@ RUN mkdir -p storage/framework/sessions storage/framework/cache/data storage/fra
60
63
&& chmod -R 775 storage bootstrap/cache
61
64
62
65
# Copy Nginx site configuration
63
- # The ric_harvey image might use /etc/nginx/conf.d/default.conf or similar.
64
- # We'll assume /etc/nginx/sites-available/default and ensure it's linked or directly used.
65
- COPY nginx-site.conf /etc/nginx/sites-available/default
66
- # If sites-enabled is used: RUN ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
66
+ # webdevops images typically load *.conf from /etc/nginx/conf.d/
67
+ # Or their main vhost config (which includes /app as root) is often in /etc/nginx/vhost.conf or part of the main nginx.conf
68
+ # We will place our specific Laravel config in conf.d to be included.
69
+ # Ensure our nginx-site.conf sets the root to /var/www/html/public.
70
+ COPY nginx-site.conf /etc/nginx/conf.d/app.conf
67
71
68
72
# Copy and set permissions for the deploy script
69
73
COPY deploy.sh /usr/local/bin/deploy.sh
0 commit comments