-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from PHPRio/feature/docker
Ambiente básico de desenvolvimento no Docker
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM php:8.2 | ||
|
||
COPY --from=composer:2.6.5 /usr/bin/composer /usr/bin/composer | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
git \ | ||
# Install node | ||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | ||
&& apt-get install --no-install-recommends -y nodejs \ | ||
&& node --version \ | ||
&& npm --version | ||
|
||
# Install PHP extensions | ||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \ | ||
&& install-php-extensions \ | ||
xdebug \ | ||
zip \ | ||
@composer \ | ||
&& rm /usr/local/bin/install-php-extensions | ||
|
||
RUN echo "alias jigsaw=./vendor/bin/jigsaw" >> ~/.bashrc && \ | ||
echo "alias compile='./vendor/bin/jigsaw build'" >> ~/.bashrc && \ | ||
/bin/bash -c "source ~/.bashrc" | ||
|
||
COPY entrypoint.sh /var/www/scripts/ | ||
ENTRYPOINT [ "bash", "/var/www/scripts/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Set uid of host machine | ||
usermod --non-unique --uid "${HOST_UID}" www-data | ||
groupmod --non-unique --gid "${HOST_GID}" www-data | ||
|
||
php /var/www/html/vendor/bin/jigsaw serve --host=0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
HTTP_PORT=80 | ||
|
||
HOST_UID=1000 | ||
HOST_GID=1000 | ||
|
||
TZ=America/Sao_Paulo | ||
|
||
XDEBUG_CONFIG="client_host=172.17.0.1 client_port=9003 start_with_request=yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
services: | ||
|
||
backend: | ||
build: .docker | ||
ports: | ||
- "127.0.0.1:${HTTP_PORT:-8000}:8000" | ||
volumes: | ||
- .:/var/www/html | ||
environment: | ||
- HOST_UID=${HOST_UID:-1000} | ||
- HOST_GID=${HOST_GID:-1000} | ||
- TZ=${TZ:-America/Sao_Paulo} | ||
- XDEBUG_CONFIG=${XDEBUG_CONFIG:-"client_host=172.17.0.1 client_port=9003 start_with_request=yes"} |