14 Commits
1.0 ... 1.1

Author SHA1 Message Date
fd2c7c00dc #tradewind:update 2021-06-25 16:09:49 +08:00
f8cd066ef2 #tradewind:update php repo 2021-06-24 15:50:59 +08:00
0041f06ff1 #tradewind:update php repo 2021-06-24 15:49:21 +08:00
5fa3908c72 #tradewind:update php repo 2021-06-24 15:43:35 +08:00
265009303e #tradewind:update composer 2021-06-15 18:20:19 +08:00
c14f1fb6d5 #tradewind:update gitignore 2021-06-08 20:22:52 +08:00
7578a5599c #tradewind:update gitignore 2021-06-08 20:22:20 +08:00
276e05d656 #tradewind:add gitignore 2021-06-08 19:03:33 +08:00
ec9b1acaec #tradewind:add gitignore 2021-06-08 18:58:04 +08:00
73e3fc7391 #tradewind:fix nginx & zip 2021-06-08 18:48:13 +08:00
00ee0c8605 #tradewind:add env 2021-06-07 15:23:23 +08:00
7483dc6775 #tradewind:add env 2021-06-07 15:22:46 +08:00
3fcb3fb886 #tradewind:add nginx 2021-06-07 15:16:11 +08:00
4d7a5e6f52 #tradewind:add nginx 2021-06-07 15:12:15 +08:00
10 changed files with 93 additions and 49 deletions

1
.env.example Normal file
View File

@ -0,0 +1 @@
LOCAL_CODE_ROOT=/var/www/http

4
.gitignore vendored
View File

@ -1,2 +1,4 @@
.idea .idea
*.iml *.iml
log
.env

View File

@ -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:

View File

@ -1,2 +1 @@
FROM mysql:5.7 FROM mysql:5.7
MAINTAINER tradewind

2
nginx/conf.d/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.conf
!example.conf

19
nginx/conf.d/example.conf Normal file
View 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
View 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
View 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

View File

@ -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

View File

@ -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