Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧑‍💻 Dev: Add Docker Image #67

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .a
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To use this file in your *nix terminal run: `source .a`
alias dc='docker-compose'
alias dce='dc exec php'
alias cl='dce sh'
alias php='dce php'
alias composer="dce composer"
alias composer-install="composer-run install"
alias dumpa='dce composer dumpa'
alias test='composer run test'
alias docker-up='dc up -d --build'
alias docker-down='dc down'
alias cl-sudo='docker exec -u root -t -i crm-php /bin/sh' # requires container to be previously up
alias make-magic='echo "Abracadabra! 🎩✨ Your code is now enchanted!"'

9 changes: 9 additions & 0 deletions .docker/php.development.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM phpdockerio/php:8.3-fpm
WORKDIR "/srv"

RUN apt-get update \
&& apt-get -y --no-install-recommends install \
git \
php8.3-xdebug \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
4 changes: 4 additions & 0 deletions .docker/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
xdebug.output_dir = /tmp/xdebug
xdebug.start_with_request = trigger
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.client_host = host.docker.internal
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
XDEBUG_MODE=debug
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"phpunit/phpunit": "^9.0|^10.0"
},
"require-dev": {
"php": "^8.2",
"friendsofphp/php-cs-fixer": "^3.0",
"orchestra/testbench": "^6.0|^8.0"
},
Expand Down
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "novaunit"

services:
php:
build:
context: .docker
dockerfile: php.development.dockerfile
restart: unless-stopped
user: 1000:1000
working_dir: /srv
volumes:
- .:/srv
- ~/.composer:/home/composer/.composer
- ./vendor:/srv/vendor:delegated
- ./storage/xdebug:/tmp/xdebug:delegated
- ./.docker/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
environment:
XDEBUG_MODE: '${XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${XDEBUG_CONFIG:-client_host=host.docker.internal}'


Loading