Files
InvoiceShelf/.dev/Dockerfile
Tim van Osch d1bca362de chore: Improve .dev dockerfile for development and production (#183)
* chore: update dockerfile and dev env

* chore(dockerfile): fix user/group id args

* chore(docker): use php-fpm w/ separate nginx

* chore(docker): add nginx image w/ static files

* chore(docker): build vite resources only once, bump vite minor version,
add watch yarn command.
By using --buildplatform tag in the dockerfile we can have the vite step
be built only on the host platform, which significantly speeds it up.
This is possible since the build assets aren't platform dependant.

* Move dockerfiles to .dev
2025-08-31 00:46:56 +02:00

36 lines
1.0 KiB
Docker

FROM --platform=$BUILDPLATFORM node AS static_builder
WORKDIR /var/www/html
COPY . /var/www/html
RUN yarn && yarn build
FROM serversideup/php:8-fpm-alpine AS base
USER root
RUN install-php-extensions exif
RUN install-php-extensions pgsql
RUN install-php-extensions sqlite3
RUN install-php-extensions imagick
RUN install-php-extensions mbstring
RUN install-php-extensions gd
RUN install-php-extensions xml
RUN install-php-extensions zip
RUN install-php-extensions redis
RUN install-php-extensions bcmath
RUN install-php-extensions intl
RUN install-php-extensions curl
FROM base AS development
ARG UID
ARG GID
USER root
RUN docker-php-serversideup-set-id www-data $UID:$GID
USER www-data
FROM base AS production
ENV AUTORUN_ENABLED=true
COPY --from=static_builder --chown=www-data:www-data /var/www/html/public /var/www/html/public
COPY --chown=www-data:www-data . /var/www/html
RUN composer install --prefer-dist
USER www-data