Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd2c7c00dc | |||
f8cd066ef2 | |||
0041f06ff1 | |||
5fa3908c72 | |||
265009303e | |||
c14f1fb6d5 | |||
7578a5599c | |||
276e05d656 | |||
ec9b1acaec | |||
73e3fc7391 | |||
00ee0c8605 | |||
7483dc6775 | |||
3fcb3fb886 | |||
4d7a5e6f52 |
1
.env.example
Normal file
1
.env.example
Normal file
@ -0,0 +1 @@
|
|||||||
|
LOCAL_CODE_ROOT=/var/www/http
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
log
|
||||||
|
.env
|
@ -1,31 +1,43 @@
|
|||||||
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
|
||||||
|
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: php74
|
||||||
ports:
|
ports:
|
||||||
- 9000:9000
|
- 9000:9000
|
||||||
restart: always
|
restart: always
|
||||||
mysql: # 添加 mysql 服务
|
mysql:
|
||||||
build:
|
build:
|
||||||
context: mysql/
|
context: mysql/
|
||||||
dockerfile: dockerfile
|
dockerfile: dockerfile
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: root
|
MYSQL_ROOT_PASSWORD: root
|
||||||
# command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci # 设置编码
|
|
||||||
# command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci #设置utf8字符集
|
|
||||||
command: --default-authentication-plugin=mysql_native_password
|
command: --default-authentication-plugin=mysql_native_password
|
||||||
# volumes:
|
# platform: linux/amd64 # apple silicon
|
||||||
# - ${MYSQL_DATA_PATH}:/var/lib/mysql
|
|
||||||
networks:
|
networks:
|
||||||
- server
|
- server
|
||||||
ports:
|
ports:
|
||||||
|
@ -1,2 +1 @@
|
|||||||
FROM mysql:5.7
|
FROM mysql:5.7
|
||||||
MAINTAINER tradewind
|
|
||||||
|
2
nginx/conf.d/.gitignore
vendored
Normal file
2
nginx/conf.d/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*.conf
|
||||||
|
!example.conf
|
19
nginx/conf.d/example.conf
Normal file
19
nginx/conf.d/example.conf
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name example.com;
|
||||||
|
root /var/www/http/example;
|
||||||
|
index index.php;
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
@ -1,44 +1,38 @@
|
|||||||
FROM php:7.4-fpm-alpine
|
FROM php:7.4-fpm
|
||||||
|
|
||||||
MAINTAINER tradewind
|
RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list
|
||||||
|
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
RUN apt-get update && apt-get install -y \
|
||||||
|
zip \
|
||||||
|
unzip \
|
||||||
|
libpq-dev \
|
||||||
|
libzip-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libicu-dev \
|
||||||
|
libjpeg62-turbo-dev \
|
||||||
|
&& docker-php-ext-configure intl \
|
||||||
|
&& docker-php-ext-install -j$(nproc) \
|
||||||
|
bcmath \
|
||||||
|
pdo_mysql \
|
||||||
|
pdo_pgsql \
|
||||||
|
gd \
|
||||||
|
zip \
|
||||||
|
exif \
|
||||||
|
sockets \
|
||||||
|
intl \
|
||||||
|
soap \
|
||||||
|
&& pecl install \
|
||||||
|
redis \
|
||||||
|
xdebug \
|
||||||
|
&& docker-php-ext-enable \
|
||||||
|
redis \
|
||||||
|
xdebug \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& apt-get autoclean
|
||||||
|
|
||||||
RUN apk add --no-cache --virtual .build-deps \
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
$PHPIZE_DEPS \
|
|
||||||
curl-dev \
|
|
||||||
imagemagick-dev \
|
|
||||||
libtool \
|
|
||||||
libxml2-dev \
|
|
||||||
postgresql-dev \
|
|
||||||
sqlite-dev \
|
|
||||||
libzip-dev \
|
|
||||||
&& apk add --no-cache \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
imagemagick \
|
|
||||||
mysql-client \
|
|
||||||
postgresql-libs \
|
|
||||||
openssl \
|
|
||||||
&& pecl install imagick \
|
|
||||||
&& docker-php-ext-enable imagick \
|
|
||||||
&& pecl install xdebug-3.0.4 \
|
|
||||||
&& docker-php-ext-enable xdebug \
|
|
||||||
&& docker-php-ext-install \
|
|
||||||
curl \
|
|
||||||
iconv \
|
|
||||||
pdo \
|
|
||||||
pdo_mysql \
|
|
||||||
pdo_pgsql \
|
|
||||||
pdo_sqlite \
|
|
||||||
pcntl \
|
|
||||||
tokenizer \
|
|
||||||
xml \
|
|
||||||
zip \
|
|
||||||
&& curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \
|
|
||||||
&& apk del -f .build-deps
|
|
||||||
|
|
||||||
# 修改 composer 为国内镜像
|
# 修改 composer 为国内镜像
|
||||||
RUN composer config -g repo.packagist composer https://packagist.laravel-china.org
|
RUN composer config -g repo.packagist composer https://mirrors.cloud.tencent.com/composer/
|
||||||
|
|
||||||
WORKDIR /var/www
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
FROM redis:6.2-alpine
|
FROM redis:6.2-alpine
|
||||||
MAINTAINER tradewind
|
|
||||||
RUN sed -i \
|
RUN sed -i \
|
||||||
's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' \
|
's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' \
|
||||||
/etc/apk/repositories && apk update
|
/etc/apk/repositories && apk update
|
Reference in New Issue
Block a user