From 65faa28b3e999152d2a92e1bfb8966e679498422 Mon Sep 17 00:00:00 2001 From: Joao Patricio Date: Wed, 31 May 2023 23:22:48 +0100 Subject: [PATCH] Fix build step --- docker/prod-ssu/Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docker/prod-ssu/Dockerfile b/docker/prod-ssu/Dockerfile index a32641e..14e4fe7 100644 --- a/docker/prod-ssu/Dockerfile +++ b/docker/prod-ssu/Dockerfile @@ -1,6 +1,13 @@ -FROM node:19 as static-assets +FROM serversideup/php:8.2-fpm-nginx as get-php-deps WORKDIR /app COPY . . +RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist + +FROM node:19 as static-assets +WORKDIR /app +COPY --from=get-php-deps /app . +RUN npm install +RUN npm run build FROM serversideup/php:8.2-fpm-nginx WORKDIR /var/www/html @@ -14,15 +21,12 @@ RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefe COPY --chown=9999:9999 . . RUN composer dump-autoload -#COPY --from=static-assets --chown=9999:9999 /app/public/build ./public/build +COPY --from=static-assets --chown=9999:9999 /app/public/build ./public/build COPY --chmod=755 docker/prod-ssu/etc/s6-overlay/ /etc/s6-overlay/ RUN php artisan route:cache RUN php artisan view:cache -WORKDIR /app -RUN npm install -RUN npm run build RUN echo "alias ll='ls -al'" >>/etc/bash.bashrc RUN echo "alias a='php artisan'" >>/etc/bash.bashrc