Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.

Commit 0d69aec

Browse files
committed
Init from poc_docker_nginx_php_mysql
0 parents  commit 0d69aec

18 files changed

+3810
-0
lines changed

Diff for: .docker/mysql/Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM mysql:8
2+
3+
ARG MYSQL_USER
4+
ARG MYSQL_PASSWORD
5+
ARG MYSQL_PORT
6+
7+
# Securise line command "mysql" and "mysqldump" (you don't need to specify user + password)
8+
RUN printf "[client]\n\
9+
host=localhost\n\
10+
user=$MYSQL_USER\n\
11+
password=$MYSQL_PASSWORD\n\
12+
port=$MYSQL_PORT\n\
13+
default-character-set=utf8" >> ~/.my.cnf

Diff for: .docker/nginx/demo.conf

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
server {
2+
listen 80 default_server;
3+
listen [::]:80 default_server;
4+
server_name demo.localhost.tv;
5+
root /var/www/public;
6+
7+
location / {
8+
try_files $uri @rewriteapp;
9+
}
10+
11+
location @rewriteapp {
12+
rewrite ^(.*)$ /index.php/$1 last;
13+
}
14+
15+
# location ~ \.php$ {
16+
location ~ ^/(index|check)\.php(/|$) {
17+
fastcgi_pass php:9000;
18+
fastcgi_split_path_info ^(.+\.php)(/.*)$;
19+
include fastcgi_params;
20+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
21+
fastcgi_param HTTPS off;
22+
}
23+
24+
error_log /var/log/nginx/demo_error.log;
25+
access_log /var/log/nginx/demo_access.log;
26+
}

Diff for: .docker/nginx/nginx.conf

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
user www-data;
2+
worker_processes 4;
3+
pid /run/nginx.pid;
4+
5+
events {
6+
worker_connections 2048;
7+
multi_accept on;
8+
use epoll;
9+
}
10+
11+
http {
12+
server_tokens off;
13+
sendfile on;
14+
tcp_nopush on;
15+
tcp_nodelay on;
16+
keepalive_timeout 15;
17+
types_hash_max_size 2048;
18+
include /etc/nginx/mime.types;
19+
default_type application/octet-stream;
20+
access_log off;
21+
error_log off;
22+
gzip on;
23+
gzip_disable "msie6";
24+
include /etc/nginx/conf.d/*.conf;
25+
include /etc/nginx/sites-enabled/*;
26+
open_file_cache max=100;
27+
}
28+
29+
# daemon off;

Diff for: .docker/php/Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM php:7.4-fpm
2+
3+
# Some libs
4+
RUN apt-get update && apt-get install -y --no-install-recommends vim curl locales apt-utils unzip
5+
6+
# https://github.com/mlocati/docker-php-extension-installer
7+
ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/
8+
9+
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && install-php-extensions \
10+
apcu opcache intl \
11+
gd imagick \
12+
pdo_mysql \
13+
mbstring \
14+
xdebug \
15+
zip
16+
17+
# PHP Conf
18+
COPY php.ini /usr/local/etc/php/php.ini
19+
COPY php-fpm-pool.conf /usr/local/etc/php/php-fpm.conf
20+
21+
# Install composer
22+
RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && \
23+
mv composer.phar /usr/local/bin/composer
24+
25+
# Purge
26+
RUN rm -rf /var/lib/apt/lists/* \
27+
&& apt-get purge --auto-remove -y g++ \
28+
&& apt-get clean
29+
30+
WORKDIR /var/www/
31+
USER www-data
32+
33+
EXPOSE 9000
34+
CMD ["php-fpm"]

0 commit comments

Comments
 (0)