forked from peppelauro/easydock
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 joglomedia/linux
v1.1.0
- Loading branch information
Showing
11 changed files
with
162 additions
and
81 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,5 @@ | ||
.env | ||
composer.lock | ||
vendor | ||
src/docker-compose.yml~ | ||
src/Dockerfile~ |
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 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,4 @@ | ||
upstream php-fpm { | ||
server webapp:9000; | ||
#server unix:/var/run/php-fpm.sock; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[global] | ||
daemonize = no | ||
|
||
; Redirect log to file. | ||
;error_log = /var/log/php/php-fpm.log | ||
|
||
[www] | ||
;user = www-data | ||
;group = www-data | ||
|
||
; Listen via socket instead tcp port. | ||
listen = 9000 | ||
;listen = /var/run/php-fpm.sock | ||
;listen.owner = www | ||
;listen.group = www | ||
;listen.mode = 0666 | ||
|
||
; Custom PHP-FPM optimization here | ||
; adjust to meet your needs. | ||
pm = dynamic | ||
pm.max_children = 5 | ||
pm.start_servers = 2 | ||
pm.min_spare_servers = 1 | ||
pm.max_spare_servers = 3 | ||
pm.process_idle_timeout = 30s | ||
pm.max_requests = 500 | ||
|
||
; Redirect log to file. | ||
;access.log = /var/log/php/php-fpm_access.log | ||
;slowlog = /var/log/php/php-fpm_slow.log | ||
;request_slowlog_timeout = 5s | ||
|
||
; Default Value: nothing is defined by default except the values in php.ini and | ||
; specified at startup with the -d argument | ||
php_admin_flag[log_errors] = On | ||
php_admin_value[error_log] = /var/log/php/php-fpm.log |
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,6 +1,5 @@ | ||
# Dockerfile Args | ||
ARG PHP_VERSION | ||
ARG NODE_VERSION | ||
|
||
# Use PHP image | ||
FROM php:${PHP_VERSION}-fpm-alpine | ||
|
@@ -12,7 +11,8 @@ LABEL maintainer Edi Septriyanto <[email protected]> architecture="amd64/x86_64" | |
WORKDIR /var/www | ||
|
||
# Add PHP extension installer | ||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions \ | ||
/usr/local/bin/ | ||
|
||
# Install dependencies | ||
RUN apk update && apk upgrade \ | ||
|
@@ -66,17 +66,21 @@ RUN apk update && apk upgrade \ | |
# Install composer | ||
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ | ||
# Install node & npm (not yet required for php application) | ||
&& apk add --update nodejs=${NODE_VERSION} npm yarn \ | ||
&& apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/main/ nodejs npm \ | ||
&& apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/community/ yarn \ | ||
# Clean up install. | ||
&& rm -rf /var/cache/apk/* \ | ||
# Add user | ||
&& set -eux; \ | ||
addgroup -g 1000 -S www; \ | ||
adduser -u 1000 -h /var/www -s /bin/bash -D -S -G www www \ | ||
&& set -eux \ | ||
&& addgroup -g 1000 -S www \ | ||
&& adduser -u 1000 -h /var/www -s /bin/bash -D -S -G www www \ | ||
# User permissions | ||
&& chown -R www:www /var/www | ||
&& chown -R www:www /var/www | ||
|
||
# Change current user to www | ||
USER www | ||
|
||
# Expose port 9000 | ||
EXPOSE 9000 | ||
|
||
CMD ["php-fpm"] |
Oops, something went wrong.