-
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 #6 from OleksiiBulba/release/0.2.0
Release/0.2.0
- Loading branch information
Showing
31 changed files
with
867 additions
and
175 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 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,12 @@ | ||
# Commands | ||
|
||
There are all available make commands: | ||
* **help** - Prints all available commands; | ||
* **run** - Run docker containers | ||
* **ps** - Show running containers | ||
* **stop** - Stops all containers | ||
* **restart** - Stops and runs again all containers | ||
* **build** - Rebuild php container if there is any changes | ||
* **rebuild** - Stops containers (if running), rebuilds php container (see build command) and starts containers back | ||
* **logs** - Show containers logs | ||
* **bash** - Show containers logs |
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,69 @@ | ||
upstream fastcgi_backend { | ||
server php:9000; | ||
} | ||
|
||
server { | ||
listen ${NGINX_PORT}; | ||
server_name ${NGINX_HOST}; | ||
root ${SITE_ROOT}; | ||
|
||
location / { | ||
# try to serve file directly, fallback to index.php | ||
try_files $uri /index.php$is_args$args; | ||
} | ||
|
||
# optionally disable falling back to PHP script for the asset directories; | ||
# nginx will return a 404 error when files are not found instead of passing the | ||
# request to Symfony (improves performance but Symfony's 404 page is not displayed) | ||
# location /bundles { | ||
# try_files $uri =404; | ||
# } | ||
|
||
add_header 'X-Content-Type-Options' 'nosniff'; | ||
add_header 'X-XSS-Protection' '1; mode=block'; | ||
|
||
location ~ ^/index\.php(/|$) { | ||
fastcgi_pass fastcgi_backend; | ||
fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||
include fastcgi_params; | ||
|
||
fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; | ||
fastcgi_param PHP_VALUE "max_execution_time=600"; | ||
fastcgi_read_timeout 600s; | ||
fastcgi_connect_timeout 600s; | ||
|
||
fastcgi_index index.php; | ||
|
||
# optionally set the value of the environment variables used in the application | ||
# fastcgi_param APP_ENV prod; | ||
# fastcgi_param APP_SECRET <app-secret-id>; | ||
# fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name"; | ||
|
||
# When you are using symlinks to link the document root to the | ||
# current version of your application, you should pass the real | ||
# application path instead of the path to the symlink to PHP | ||
# FPM. | ||
# Otherwise, PHP's OPcache may not properly detect changes to | ||
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 | ||
# for more information). | ||
# Caveat: When PHP-FPM is hosted on a different machine from nginx | ||
# $realpath_root may not resolve as you expect! In this case try using | ||
# $document_root instead. | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param DOCUMENT_ROOT $realpath_root; | ||
include fastcgi_params; | ||
# Prevents URIs that include the front controller. This will 404: | ||
# http://domain.tld/index.php/some-path | ||
# Remove the internal directive to allow URIs like this | ||
internal; | ||
} | ||
|
||
# return 404 for all other php files not matching the front controller | ||
# this prevents access to other php files you don't want to be accessible. | ||
location ~ \.php$ { | ||
return 404; | ||
} | ||
|
||
error_log /var/log/nginx/project_error.log; | ||
access_log /var/log/nginx/project_access.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 |
---|---|---|
@@ -0,0 +1,124 @@ | ||
ARG PHP_VERSION=8.0.6 | ||
FROM php:${PHP_VERSION}-fpm | ||
|
||
ENV INSTALL_DIR /var/www/html | ||
ENV SSH_USER root | ||
ENV SSH_PASSWORD root | ||
|
||
# sodium | ||
# php ^7.2 | ||
RUN apt-get update && apt-cache search libsodium && apt-get install -y libsodium-dev # libsodium18 | ||
|
||
# Install System Dependencies | ||
RUN requirements="libcurl3-dev libfreetype6 libjpeg62-turbo libjpeg62-turbo-dev libpng-dev libfreetype6-dev libicu-dev libxslt1-dev" \ | ||
apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends software-properties-common \ | ||
&& apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
libcurl3-dev libfreetype6 libjpeg62-turbo libjpeg62-turbo-dev libpng-dev libfreetype6-dev libicu-dev libxslt1-dev \ | ||
libicu-dev \ | ||
libssl-dev \ | ||
libedit-dev \ | ||
libedit2 \ | ||
libxslt1-dev \ | ||
apt-utils \ | ||
gnupg \ | ||
redis-tools \ | ||
default-mysql-client \ | ||
git \ | ||
vim \ | ||
nano \ | ||
wget \ | ||
curl \ | ||
lynx \ | ||
psmisc \ | ||
libzip-dev \ | ||
libonig-dev \ | ||
unzip \ | ||
tar \ | ||
cron \ | ||
bash-completion \ | ||
&& apt-get clean | ||
|
||
# Install XDebug | ||
RUN yes | pecl install xdebug && \ | ||
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
RUN docker-php-ext-configure \ | ||
gd --with-freetype=/usr/include/ \ | ||
--with-jpeg=/usr/include/ \ | ||
&& docker-php-ext-install gd \ | ||
&& docker-php-ext-install zip \ | ||
&& docker-php-ext-install intl \ | ||
&& docker-php-ext-install xsl \ | ||
&& docker-php-ext-install soap \ | ||
&& docker-php-ext-install bcmath \ | ||
&& docker-php-ext-install sodium \ | ||
&& docker-php-ext-install pdo_mysql \ | ||
&& docker-php-ext-install sockets \ | ||
&& docker-php-ext-enable xdebug \ | ||
&& apt-get purge --auto-remove -y libcurl3-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev | ||
|
||
# Install OpenSSH server | ||
RUN apt-get update \ | ||
&& apt-get install -y openssh-server \ | ||
sudo \ | ||
openssh-server | ||
RUN mkdir /var/run/sshd | ||
RUN echo "${SSH_USER}:${SSH_PASSWORD}" | chpasswd | ||
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config | ||
# SSH login fix. Otherwise user is kicked off after login | ||
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | ||
EXPOSE 22 | ||
|
||
# Install oAuth | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
libpcre3 \ | ||
libpcre3-dev \ | ||
# php-pear \ | ||
&& pecl install oauth \ | ||
&& echo "extension=oauth.so" > /usr/local/etc/php/conf.d/docker-php-ext-oauth.ini | ||
|
||
# Install Node, NVM, NPM and Grunt | ||
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash - \ | ||
&& apt-get install -y nodejs build-essential \ | ||
&& curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | sh \ | ||
&& npm i -g grunt-cli yarn requirejs | ||
|
||
# Install Composer | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer | ||
ENV PATH="/var/www/.composer/vendor/bin/:${PATH}" | ||
|
||
RUN echo "memory_limit=2048M" >> /usr/local/etc/php/conf.d/common.ini \ | ||
&& echo "max_execution_time=1000" >> /usr/local/etc/php/conf.d/common.ini \ | ||
&& echo "max_input_time=1000" >> /usr/local/etc/php/conf.d/common.ini | ||
|
||
# Install Mhsendmail | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install golang-go \ | ||
&& mkdir /opt/go \ | ||
&& export GOPATH=/opt/go \ | ||
&& go get github.com/mailhog/mhsendmail | ||
|
||
# Configuring system | ||
COPY ./config/ini/ /usr/local/etc/php/conf.d/ | ||
COPY ./config/php-fpm/ /usr/local/etc/php-fpm/ | ||
COPY ./bin/* /usr/local/bin/ | ||
COPY ./users/* /var/www/ | ||
COPY ./config/crontab /etc/cron.d/crontab | ||
RUN chmod +x /usr/local/bin/* | ||
|
||
RUN chmod 777 -Rf /var/www /var/www/.* \ | ||
&& chown -Rf www-data:www-data /var/www /var/www/.* \ | ||
&& usermod -u 1000 www-data \ | ||
&& chsh -s /bin/bash www-data | ||
|
||
COPY ./bin/ /docker/scripts | ||
RUN chown -R www-data /docker/scripts/* | ||
RUN chmod ug+rx /docker/scripts/* | ||
|
||
VOLUME ${INSTALL_DIR} | ||
WORKDIR ${INSTALL_DIR} | ||
USER www-data | ||
|
||
CMD bash -c '/docker/scripts/entrypoint' |
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,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
php-fpm |
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 @@ | ||
# * * * * * /usr/local/bin/php /var/www/html/bin/cron "cron options" >> /var/www/html/var/log/cron.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
opcache.enable = 1 | ||
opcache.enable_cli = 1 | ||
opcache.memory_consumption = 512M | ||
opcache.max_accelerated_files = 100000 | ||
opcache.validate_timestamps=0 | ||
opcache.consistency_checks=0 | ||
opcache.interned_strings_buffer=8 | ||
opcache.fast_shutdown=1 | ||
opcache.revalidate_freq = 0 | ||
opcache.revalidate_path = 1 |
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,9 @@ | ||
memory_limit = 2048M | ||
max_execution_time = 38000 | ||
always_populate_raw_post_data = -1 | ||
date.timezone = "UTC" | ||
upload_max_filesize = 128M | ||
zlib.output_compression = on | ||
log_errors = On | ||
display_errors = On | ||
sendmail_path = "/opt/go/bin/mhsendmail --smtp-addr='mailhog:1025'" |
Oops, something went wrong.