-
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #29 from mhzawadi/dev
Nginx unit build
- Loading branch information
Showing
4 changed files
with
87 additions
and
14 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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FROM alpine:3.20 | ||
MAINTAINER Matthew Horwood <[email protected]> | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
# Install required deb packages | ||
RUN apk update && \ | ||
apk add gnupg nginx php82-fpm php82-common php82-iconv php82-json php82-gd \ | ||
apk add gnupg unit-php82 php82-common php82-iconv php82-json php82-gd \ | ||
php82-curl php82-xml php82-mysqli php82-imap php82-pdo php82-pdo_mysql \ | ||
php82-soap php82-posix php82-gettext php82-ldap \ | ||
php82-ctype php82-dom php82-session php82-mbstring curl \ | ||
|
@@ -14,8 +14,8 @@ RUN apk update && \ | |
ln -s /usr/bin/php82 /usr/bin/php; | ||
|
||
# Calculate download URL | ||
ENV VERSION 5.2.1 | ||
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz | ||
ENV VERSION=5.2.1 | ||
ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz | ||
LABEL version=$VERSION | ||
|
||
# Download tarball, verify it using gpg and extract | ||
|
@@ -47,14 +47,12 @@ RUN set -ex; \ | |
cp -R /usr/src/phpmyadmin/* /var/www/html/; \ | ||
cp /config/config.inc.php /etc/phpmyadmin/config.inc.php && \ | ||
cp /config/php.ini /etc/php82/php.ini && \ | ||
cp /config/php_fpm_site.conf /etc/php82/php-fpm.d/www.conf; \ | ||
chown -R nobody:nginx /var/www/html /sessions; \ | ||
cp /config/nginx_site.conf /etc/nginx/http.d/default.conf; \ | ||
chown -R unit:unit /var/www/html /sessions; \ | ||
cp /config/healthcheck.php /var/www/html/; | ||
|
||
EXPOSE 80 | ||
ENTRYPOINT ["/config/start.sh"] | ||
CMD ["nginx", "-g", "daemon off;"] | ||
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] | ||
|
||
## Health Check | ||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \ | ||
|
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,4 +1,4 @@ | ||
version: '3.5' | ||
--- | ||
|
||
# docker stack deploy --compose-file stack-phpmyadmin.yml phpmyadmin | ||
|
||
|
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,34 @@ | ||
{ | ||
"listeners": { | ||
"*:80": { | ||
"pass": "routes" | ||
} | ||
}, | ||
|
||
"routes": [ | ||
{ | ||
"match": { | ||
"uri": "~\\.(css|gif|html?|ico|jpg|js(on)?|png|svg|ttf|woff2?)$" | ||
}, | ||
|
||
"action": { | ||
"share": "/var/www/html$uri" | ||
} | ||
}, | ||
{ | ||
"action": { | ||
"pass": "applications/phpmyadmin" | ||
} | ||
} | ||
], | ||
|
||
"applications": { | ||
"phpmyadmin": { | ||
"type": "php", | ||
"root": "/var/www/html/" | ||
} | ||
}, | ||
"access_log": { | ||
"path": "/var/log/unit/access.log" | ||
} | ||
} |