-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use nginx unit as web server for docker image
- Loading branch information
Showing
10 changed files
with
91 additions
and
99 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
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 was deleted.
Oops, something went wrong.
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,33 @@ | ||
FROM php:8.2-fpm | ||
FROM unit:1.32.0-php8.2 | ||
|
||
RUN apt update && \ | ||
apt install -qy wget curl git zip unzip && \ | ||
apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.1.58/install-php-extensions /usr/local/bin/ | ||
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/download/2.2.5/install-php-extensions /usr/local/bin/ | ||
RUN install-php-extensions @composer zip | ||
|
||
COPY docker/php/unit.json /docker-entrypoint.d/config.json | ||
COPY docker/php/php.ini /usr/local/etc/php/conf.d/satisfy.ini | ||
RUN chown -R www-data:www-data /var/www | ||
|
||
USER www-data | ||
RUN mkdir -p ~/.ssh && chmod 0700 ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts && \ | ||
mkdir -p ~/.composer && \ | ||
wget -O ~/.composer/keys.dev.pub https://composer.github.io/snapshots.pub && \ | ||
wget -O ~/.composer/keys.tags.pub https://composer.github.io/releases.pub && \ | ||
mkdir -p /var/www/satisfy/var && \ | ||
mkdir -p /var/www/satisfy/public | ||
wget -O ~/.composer/keys.tags.pub https://composer.github.io/releases.pub | ||
VOLUME /var/www/.composer | ||
|
||
ENV APP_PATH=/var/www/satisfy | ||
ENV APP_PATH=/var/www/html | ||
ENV APP_ENV=prod | ||
ENV APP_DEBUG=0 | ||
WORKDIR /var/www/satisfy | ||
ENV COMPOSER_HOME=/var/www/.composer | ||
ENV COMPOSER_CACHE=/var/www/html/var/cache/composer | ||
WORKDIR /var/www/html | ||
|
||
VOLUME /var/www/.composer | ||
VOLUME /var/www/satisfy | ||
COPY --chown=www-data:www-data . /var/www/html/ | ||
|
||
RUN mkdir /var/www/html/var | ||
VOLUME /var/www/html/var | ||
|
||
COPY --chown=www-data:www-data . /var/www/satisfy/ | ||
USER root |
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,52 @@ | ||
{ | ||
"listeners": { | ||
"*:80": { | ||
"pass": "routes" | ||
} | ||
}, | ||
"routes": [ | ||
{ | ||
"match": { | ||
"uri": [ | ||
"*.php", | ||
"*.php/*" | ||
] | ||
}, | ||
"action": { | ||
"pass": "applications/satisfy/direct" | ||
} | ||
}, | ||
{ | ||
"action": { | ||
"share": "/var/www/html/public$uri", | ||
"fallback": { | ||
"pass": "applications/satisfy/index" | ||
} | ||
} | ||
} | ||
], | ||
"applications": { | ||
"satisfy": { | ||
"type": "php", | ||
"processes": { | ||
"max": 16, | ||
"spare": 1, | ||
"idle_timeout": 30 | ||
}, | ||
"user": "www-data", | ||
"group": "www-data", | ||
"working_directory": "/var/www/html", | ||
"stderr": "/dev/stderr", | ||
"stdout": "/dev/stdout", | ||
"targets": { | ||
"direct": { | ||
"root": "/var/www/html" | ||
}, | ||
"index": { | ||
"root": "/var/www/html/public", | ||
"script": "index.php" | ||
} | ||
} | ||
} | ||
} | ||
} |