diff --git a/Dockerfile b/Dockerfile index f6edb7d..a333972 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,17 @@ ADD composer.json composer.lock ./ RUN composer install --optimize-autoloader --ignore-platform-reqs --no-dev +FROM node:22-alpine AS node + +# Set the working directory to /app +WORKDIR /app/front-end + +# Copy package.json and package-lock.json to the working directory +COPY front-end/ . + +# Install Node.js dependencies +RUN npm install && npm run build + # Use the official PHP CLI image with Alpine Linux for the second stage FROM siteworxpro/php:8.5.1-cli-alpine AS php @@ -43,6 +54,9 @@ COPY --from=roadrunner /usr/bin/rr /usr/local/bin/rr # Copy the installed PHP dependencies from the library stage COPY --from=library /app/vendor /app/vendor +# Copy the built front-end assets from the node stage +COPY --from=node /app/public /app/public + # Copy the RoadRunner configuration file and source ADD src src/ ADD generated generated/