-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'improve-docker' into github-workflow-ci
- Loading branch information
Showing
3 changed files
with
46 additions
and
8 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,7 @@ | ||
/build/ | ||
/config.php | ||
/index.json | ||
/.php_cs.cache | ||
/var/ | ||
/vendor/ | ||
!.gitkeep |
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 |
---|---|---|
@@ -1,21 +1,51 @@ | ||
FROM php:7.4-cli | ||
## | ||
## base image setup | ||
# | ||
FROM php:7.4-cli as base | ||
|
||
USER root | ||
|
||
RUN apt update && apt install libgearman-dev zip unzip gearman-tools bc procps jq apache2-utils retry -y && pecl install gearman | ||
|
||
RUN docker-php-ext-enable gearman \ | ||
&& docker-php-ext-configure pcntl --enable-pcntl \ | ||
&& docker-php-ext-install pcntl | ||
RUN apt update && apt install libgearman-dev zip unzip gearman-tools bc procps jq apache2-utils retry -y && rm -rf /var/lib/apt/lists/* | ||
RUN pecl install gearman && docker-php-ext-enable gearman | ||
RUN docker-php-ext-configure pcntl --enable-pcntl && docker-php-ext-install pcntl | ||
|
||
COPY .docker/php.ini /usr/local/etc/php/php.ini | ||
|
||
WORKDIR /app | ||
|
||
|
||
## | ||
## Composer Dependency builder | ||
# | ||
FROM base as deps | ||
COPY composer.json composer.json | ||
COPY composer.lock composer.lock | ||
COPY --from=composer:2.4 /usr/bin/composer /usr/bin/composer | ||
COPY . /app/ | ||
RUN composer install | ||
|
||
## | ||
## Application builder | ||
# | ||
FROM base as app | ||
COPY . /app/ | ||
COPY --from=deps /app/vendor /app/vendor | ||
|
||
## | ||
## Dev environment | ||
# | ||
FROM app as dev | ||
|
||
# Install additional tools needed for tests | ||
RUN apt update && apt install apache2-utils retry -y | ||
|
||
# Use the PHP dev server to run the app | ||
CMD ["php", "-S", "0.0.0.0:80", "-t", "./web", "./web/app_dev.php"] | ||
EXPOSE 80 | ||
|
||
## | ||
## Prod environment | ||
# | ||
FROM app as prod | ||
|
||
# TODO: Replace with a more production ready webserver | ||
CMD ["php", "-S", "0.0.0.0:80", "-t", "./web", "./web/app_dev.php"] | ||
EXPOSE 80 |
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