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
This commit is contained in:
Tim van Osch
2025-08-31 00:46:56 +02:00
committed by GitHub
parent d5137e393d
commit d1bca362de
15 changed files with 2839 additions and 204 deletions

View File

@@ -2,28 +2,32 @@ services:
php-fpm:
container_name: invoiceshelf-dev-php
build:
context: ./php
dockerfile: Dockerfile
context: ..
dockerfile: .dev/Dockerfile
args:
- UID=${USRID:-1000}
- GID=${GRPID:-1000}
target: development
volumes:
- ../:/home/invoiceshelf/app
ports:
- 5173:5173
- ../:/var/www/html
networks:
- invoiceshelf-dev
nginx:
container_name: invoiceshelf-dev-nginx
image: nginx:stable
build:
context: ..
dockerfile: .dev/nginx.Dockerfile
environment:
- "PHP_FPM_HOST=php-fpm:9000"
ports:
- '80:80'
volumes:
- ./nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
- ../:/home/invoiceshelf/app
- ../:/var/www/html
networks:
- invoiceshelf-dev
invoiceshelf-dev:
aliases:
- invoiceshelf.test
adminer:
container_name: invoiceshelf-dev-adminer
@@ -43,10 +47,9 @@ services:
mail:
container_name: invoiceshelf-dev-mailpit
image: axllent/mailpit:latest
restart: always
ports:
- 1025:1025
- 8025:8025
- '1025:1025'
- '8025:8025'
networks:
- invoiceshelf-dev