Update docker config and add example compose file

This commit is contained in:
yuriko 🦊 2025-05-24 01:44:09 -04:00
parent 8d3f792134
commit 3ac3fde2c6
Signed by: jaiden
SSH key fingerprint: SHA256:f8tvveBoXBrKZIQDWLLcpQrKbATUCGg98x2N4YzkDM8
5 changed files with 125 additions and 53 deletions

28
deploy/Dockerfile Normal file
View file

@ -0,0 +1,28 @@
# Stage 1: Build
FROM joseluisq/php-fpm:8.4 AS build
RUN apk add --no-cache nodejs npm
WORKDIR /var/www/html
COPY --chown=www-data:www-data . .
RUN chmod -R 775 /var/www/html/storage \
&& chmod -R 775 /var/www/html/bootstrap/cache
RUN composer install --no-dev --prefer-dist \
&& npm install \
&& npm run build
RUN chown -R www-data:www-data /var/www/html/vendor \
&& chmod -R 775 /var/www/html/vendor
# Stage 2: Deploy
FROM joseluisq/php-fpm:8.4
COPY --from=build /var/www/html /var/www/html
WORKDIR /var/www/html
VOLUME ["/var/www/html/storage/app"]
EXPOSE 9000
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=9000", "--tries=1"]