Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0058b2c

Browse files
author
Your Name
committed
docker
0 parents commit 0058b2c

File tree

6 files changed

+131
-0
lines changed

6 files changed

+131
-0
lines changed

‎Dockerfile‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM php:fpm
2+
RUN apt-get update \
3+
&& apt-get install -y --no-install-recommends curl libpq-dev libmcrypt-dev libfreetype6-dev libjpeg-dev libldap2-dev libpng12-dev zlib1g-dev libxml2-dev \
4+
&& docker-php-ext-install pdo_mysql soap intl \
5+
&& docker-php-ext-configure gd --enable-gd-native-ttf --with-jpeg-dir=/usr/lib/x86_64-linux-gnu --with-png-dir=/usr/lib/x86_64-linux-gnu --with-freetype-dir=/usr/lib/x86_64-linux-gnu \
6+
&& docker-php-ext-install gd
7+
RUN apt-get install -y libicu-dev
8+
RUN pecl install intl
9+
10+
RUN apt-get install -y git zip unzip
11+
12+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer
13+
RUN composer global require "fxp/composer-asset-plugin:^1.2.0"

‎app/.gitkeep‎

Whitespace-only changes.

‎docker-compose.yml‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PHP
2+
phpfpm:
3+
build: .
4+
restart: always
5+
links:
6+
- db:db
7+
volumes:
8+
- ./app:/var/www/html
9+
# NGINX
10+
nginx:
11+
restart: always
12+
image: nginx
13+
ports:
14+
- "8099:80"
15+
links:
16+
- phpfpm:phpfpm
17+
volumes:
18+
- ./nginx/vhost.conf:/etc/nginx/conf.d/default.conf
19+
- ./app:/var/www/html
20+
- ./log/nginx:/var/log/nginx
21+
# MYSQL
22+
db:
23+
restart: always
24+
image: mysql
25+
# ports:
26+
# - "3320:3306"
27+
environment:
28+
MYSQL_ROOT_PASSWORD: 123456
29+
MYSQL_USER: user
30+
MYSQL_PASSWORD: password
31+
MYSQL_DATABASE: database

‎log/nginx/.gitkeep‎

Whitespace-only changes.

‎log/php-fpm/.gitkeep‎

Whitespace-only changes.

‎nginx/vhost.conf‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
server {
2+
#listen [::]:80 ipv6only=on; # listen for IPv6
3+
server_name docker.my;
4+
root /var/www/html/yii;
5+
6+
access_log /var/log/nginx/new-access.log;
7+
error_log /var/log/nginx/new-error.log;
8+
charset utf-8;
9+
client_max_body_size 100M;
10+
11+
location / {
12+
root /var/www/html/yii/frontend/web/;
13+
try_files $uri /index.php?$args;
14+
}
15+
16+
17+
location ~* \.php$ {
18+
try_files $uri /frontend/web$uri =404;
19+
# check the www.conf file to see if PHP-FPM is listening on a socket or a port
20+
fastcgi_pass phpfpm:9000;
21+
#fastcgi_pass 127.0.0.1:9000; # listen for port
22+
include /etc/nginx/fastcgi_params;
23+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
24+
}
25+
26+
# avoid processing of calls to non-existing static files by Yii (uncomment if necessary)
27+
#location ~* \.(css|js|jpg|jpeg|png|gif|bmp|ico|mov|swf|pdf|zip|rar)$ {
28+
# access_log off;
29+
# log_not_found off;
30+
# try_files $uri /frontend/web$uri =404;
31+
#}
32+
33+
location ~* \.(htaccess|htpasswd|svn|git) {
34+
deny all;
35+
}
36+
37+
38+
39+
location /api {
40+
alias /var/www/html/yii/frontend/web;
41+
try_files $uri /frontend/web/index.php?$args;
42+
43+
# redirect to the page without a trailing slash (uncomment if necessary)
44+
#location = /admin/ {
45+
# return 301 /admin;
46+
#}
47+
48+
location ~* ^/admin/(.+\.php)$ {
49+
try_files $uri /frontend/web/1ドル?$args;
50+
}
51+
52+
# avoid processing of calls to non-existing static files by Yii (uncomment if necessary)
53+
#location ~* ^/admin/(.+\.(css|js|jpg|jpeg|png|gif|bmp|ico|mov|swf|pdf|zip|rar))$ {
54+
# try_files $uri /frontend/web/1ドル?$args;
55+
#}
56+
}
57+
58+
59+
60+
location /admin {
61+
alias /var/www/html/yii/backend/web;
62+
try_files $uri /backend/web/index.php?$args;
63+
64+
# redirect to the page without a trailing slash (uncomment if necessary)
65+
#location = /admin/ {
66+
# return 301 /admin;
67+
#}
68+
69+
location ~* ^/admin/(.+\.php)$ {
70+
try_files $uri /backend/web/1ドル?$args;
71+
}
72+
73+
# avoid processing of calls to non-existing static files by Yii (uncomment if necessary)
74+
#location ~* ^/admin/(.+\.(css|js|jpg|jpeg|png|gif|bmp|ico|mov|swf|pdf|zip|rar))$ {
75+
# try_files $uri /backend/web/1ドル?$args;
76+
#}
77+
}
78+
79+
80+
location /images/ {
81+
root /var/www/html/;
82+
}
83+
84+
85+
86+
87+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /