This commit is contained in:
Lizandro Guarnizo
2026-06-05 09:17:56 -05:00
parent feca07dd79
commit 32dfdcf132
2 changed files with 32 additions and 9 deletions
+3 -1
View File
@@ -4,12 +4,12 @@
.gitattributes
node_modules
vendor
public/build
storage/framework/cache/data
storage/framework/sessions
storage/framework/views
storage/logs
storage/app/public
public/build
.dockerignore
docker-compose.yml
*.md
@@ -17,3 +17,5 @@ docker-compose.yml
phpunit.xml
tests
scripts
bootstrap/cache/*.php
!bootstrap/cache/.gitkeep
+29 -8
View File
@@ -1,10 +1,30 @@
FROM php:8.2-alpine
FROM composer:2 AS vendor
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install \
--no-dev \
--optimize-autoloader \
--no-interaction \
--no-scripts \
--no-autoloader
FROM node:22-alpine AS frontend
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY resources/ resources/
COPY vite.config.js ./
RUN npm run build
FROM php:8.2-fpm-alpine
RUN apk add --no-cache \
postgresql-dev \
nginx \
supervisor \
curl \
postgresql-dev \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
@@ -18,16 +38,15 @@ WORKDIR /app
COPY . .
RUN composer install --no-dev --optimize-autoloader --no-interaction \
COPY --from=vendor /app/vendor vendor/
COPY --from=frontend /app/public/build public/build/
RUN composer dump-autoload --no-dev --optimize \
&& php artisan storage:link \
&& php artisan package:discover --ansi \
&& chmod -R 775 storage bootstrap/cache \
&& chown -R www-data:www-data storage bootstrap/cache
RUN apk add --no-cache nodejs npm \
&& npm ci && npm run build \
&& rm -rf node_modules \
&& apk del nodejs npm
COPY docker/nginx.conf /etc/nginx/http.d/default.conf
COPY docker/supervisord.conf /etc/supervisor.conf
@@ -35,4 +54,6 @@ RUN echo "* * * * * php /app/artisan schedule:run >> /dev/null 2>&1" > /etc/cron
EXPOSE 80
STOPSIGNAL SIGQUIT
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor.conf"]