Docker local env updates
All checks were successful
Run code tests / Run-code-test (push) Successful in 1m1s

This commit is contained in:
Chicory ☕ 2024-07-29 18:45:50 +03:00
parent 01d05bbbcf
commit d6d7fbfacc
Signed by: chicory
GPG Key ID: AC95A793F70BEDCD
4 changed files with 45 additions and 16 deletions

View File

@ -1,22 +1,32 @@
composer := docker-compose run --rm composer-package-testing composer -d app service_name := composer-package-dev
compose_file := ./docker/docker-compose.yaml
compose_command := PUID=${UID} PGID=${GID} docker-compose -f $(compose_file)
compose_run := $(compose_command) run --rm $(service_name)
build:
@$(compose_command) build
install: install:
@$(composer) install @make build
@$(compose_run) composer install
prune: prune:
@docker-compose rm -fsv @$(compose_command) rm -fsv
exec-shell:
@$(compose_run) sh
code-style-fix: code-style-fix:
@$(composer) code-style-fix @$(compose_run) composer code-style-fix
code-style-check: code-style-check:
@$(composer) code-style-check @$(compose_run) composer code-style-check
analyze-code: analyze-code:
@$(composer) analyze-code @$(compose_run) composer analyze-code
run-unit-tests: run-unit-tests:
@$(composer) run-unit-tests @$(compose_run) composer run-unit-tests
full-test: full-test:
@$(composer) full-test @$(compose_run) composer full-test

View File

@ -1,8 +0,0 @@
---
version: "3.9"
services:
composer-package-testing:
image: ch1c0ry/php8-cli-actrunner
volumes:
- .:/app

16
docker/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM php:8.3-fpm-alpine
RUN apk add --no-cache make
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
ARG PUID=1000
ARG PGID=1000
RUN addgroup -g ${PGID} www && adduser -u ${PUID} -G www -s /bin/sh -D www
COPY --chown=www:www ./ /var/www
USER www
WORKDIR /var/www

View File

@ -0,0 +1,11 @@
---
services:
composer-package-dev:
build:
context: ../
dockerfile: ./docker/Dockerfile
args:
- PUID=${PUID}
- PGID=${PGID}
volumes:
- ..:/var/www