#tradewind:add nginx
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
.env
|
@ -1,13 +1,28 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
nginx:
|
||||||
|
build:
|
||||||
|
context: ./nginx/
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
networks:
|
||||||
|
- server
|
||||||
|
volumes:
|
||||||
|
- ./nginx/conf.d:/etc/nginx/conf.d
|
||||||
|
- ./nginx/sources.list:/etc/apt/sources.list
|
||||||
|
- ${LOCAL_CODE_ROOT}:/var/www/http
|
||||||
|
- ./log/nginx:/var/log/nginx
|
||||||
|
container_name: nginx-server
|
||||||
|
restart: always
|
||||||
php7.4:
|
php7.4:
|
||||||
build:
|
build:
|
||||||
context: ./php7.4/
|
context: ./php7.4/
|
||||||
dockerfile: dockerfile
|
dockerfile: dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- ./php7.4/sources.list:/etc/apt/sources.list
|
- ./php7.4/sources.list:/etc/apt/sources.list
|
||||||
- /var/www/http:/var/www/http
|
- ${LOCAL_CODE_ROOT}:/var/www/http
|
||||||
networks:
|
networks:
|
||||||
- server
|
- server
|
||||||
container_name: php7.4
|
container_name: php7.4
|
||||||
|
18
nginx/conf.d/example.conf
Normal file
18
nginx/conf.d/example.conf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name example.com;
|
||||||
|
root /var/www/http/example;
|
||||||
|
location / {
|
||||||
|
index index.php index.html error/index.html;
|
||||||
|
autoindex off;
|
||||||
|
}
|
||||||
|
location ~ \.php(.*)$ {
|
||||||
|
fastcgi_pass php7.4:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||||
|
include fastcgi_params;
|
||||||
|
}
|
||||||
|
}
|
6
nginx/dockerfile
Normal file
6
nginx/dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
MAINTAINER tradewind
|
||||||
|
RUN sed -i \
|
||||||
|
's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' \
|
||||||
|
/etc/apk/repositories && apk update
|
||||||
|
WORKDIR /var/www/http/
|
9
nginx/sources.list
Normal file
9
nginx/sources.list
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
|
||||||
|
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
|
||||||
|
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
|
||||||
|
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
|
||||||
|
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
|
||||||
|
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
|
||||||
|
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
|
||||||
|
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
|
||||||
|
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
|
Reference in New Issue
Block a user