Skip to content

Commit 0b9de3b

Browse files
committed
Update Dockerfile
1 parent 15e083f commit 0b9de3b

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Dockerfile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,28 @@ COPY resources/img ./resources/img
2323
RUN npm run production
2424

2525
# 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
2727

2828
# 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.
2931
WORKDIR /var/www/html
3032

3133
# 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.
3638
USER root
37-
RUN apk add --no-cache \
39+
RUN apk add --no-cache --virtual .build-deps \
40+
$PHPIZE_DEPS \
3841
libzip-dev \
3942
libpng-dev \
40-
libjpeg-turbo-dev \
43+
jpeg-dev \
4144
freetype-dev \
4245
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
4346
&& 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 \
4548
&& rm -rf /var/cache/apk/*
4649

4750
# Install Composer globally
@@ -60,10 +63,11 @@ RUN mkdir -p storage/framework/sessions storage/framework/cache/data storage/fra
6063
&& chmod -R 775 storage bootstrap/cache
6164

6265
# 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
6771

6872
# Copy and set permissions for the deploy script
6973
COPY deploy.sh /usr/local/bin/deploy.sh

0 commit comments

Comments
 (0)