mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update docker-compose.yml and readme
This commit is contained in:
parent
b2cd17b82f
commit
e4b02be7a2
@ -7,11 +7,11 @@ APP_URL=http://localhost
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_HOST=db
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
DB_PASSWORD=123456
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
@ -49,4 +49,4 @@ DEFAULT_INVITE_FORCE=0
|
||||
DEFAULT_INVITE_COMMISSION=10
|
||||
DEFAULT_INVITE_GEN_LIMIT=5
|
||||
DEFAULT_STOP_REGISTER=0
|
||||
DEFAULT_EMAIL_VERIFY=0
|
||||
DEFAULT_EMAIL_VERIFY=0
|
||||
|
@ -2,10 +2,10 @@ version: '3'
|
||||
|
||||
services:
|
||||
db:
|
||||
container_name: v2board-db
|
||||
image: mysql
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
environment:
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=true
|
||||
- MYSQL_ROOT_PASSWORD=123456
|
||||
volumes:
|
||||
- ./docker/mysql:/var/lib/mysql
|
||||
- ./install.sql:/install.sql
|
||||
|
29
readme.md
29
readme.md
@ -1,36 +1,39 @@
|
||||
|
||||
## Environment:
|
||||
## 依赖环境:
|
||||
|
||||
- PHP7.3+
|
||||
- composer
|
||||
- MySQL5.5+
|
||||
|
||||
## Steps
|
||||
----
|
||||
|
||||
### Before
|
||||
|
||||
执行 `cp .env.example .env` 然后配置它;
|
||||
|
||||
### 本地环境部署
|
||||
## 本地环境部署
|
||||
|
||||
1. 下载 composer
|
||||
> ```shell script
|
||||
> wget https://getcomposer.org/download/1.9.0/composer.phar
|
||||
> php composer.phar install
|
||||
> ```
|
||||
2. 初始化项目
|
||||
2. 从 `install.sql` 文件中恢复表
|
||||
3. 执行 `cp .env.example .env` 然后配置它
|
||||
4. 执行配置脚本
|
||||
> ```shell script
|
||||
> sh init.sh
|
||||
> ```
|
||||
>
|
||||
3. 从 `install.sql` 文件中恢复表
|
||||
|
||||
---
|
||||
|
||||
### Docker 环境部署
|
||||
1. 初始化项目
|
||||
## Docker 环境部署
|
||||
1. 执行 `docker-compose run --rm db` 进入 docker 容器
|
||||
2. 从 `install.sql` 文件中恢复表后退出容器,执行 `docker-compose down`
|
||||
3. 执行 `cp .env.example .env` 然后配置它
|
||||
4. 执行配置脚本
|
||||
> ```shell script
|
||||
> docker run --rm -v $(pwd):/app composer install
|
||||
> docker run --rm -v $(pwd):/app composer sh init.sh
|
||||
> ```
|
||||
2. 进入 docker 容器从 `install.sql` 文件中恢复表
|
||||
3. 执行 `docker-compose up -d` 启动服务
|
||||
4. 执行 `docker-compose up -d` 启动服务
|
||||
|
||||
## 注意
|
||||
每次修改 `.env` 文件后需要执行 `docker run --rm -v $(pwd):/app composer sh init.sh`
|
||||
|
Loading…
Reference in New Issue
Block a user