Skip to content

Commit

Permalink
[ENHANCEMENT] add docker-compose for easy jump in development
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Ageev committed Jan 26, 2023
1 parent d250471 commit d03b46d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .docker/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM php:8.1-cli-alpine
ENV XDG_CACHE_HOME=/tmp/.cache
ENV COMPOSER_CACHE_DIR=${XDG_CACHE_HOME}/composer
# posible could install cache directory here
RUN --mount=type=bind,from=mlocati/php-extension-installer:1.5,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
install-php-extensions zip xdebug-stable
RUN addgroup -S app && adduser -S app -G app
RUN mkdir -p /app && chown -R app /app && mkdir -p /tmp && chown -R app /tmp
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
USER app
WORKDIR /app
4 changes: 4 additions & 0 deletions .docker/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[xdebug]
zend_extension="xdebug.so"
xdebug.client_host=host.docker.internal
xdebug.mode=debug
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/.github export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/.docker export-ignore
/docker-compose.yaml export-ignore
11 changes: 11 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: "3.9"
services:
cli:
build:
dockerfile: .docker/Dockerfile.local
context: .
working_dir: /app
volumes:
- ./:/app
- ~/.composer/cache/:/tmp/cache/
- ./.docker/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini:ro

0 comments on commit d03b46d

Please sign in to comment.