mirror of
https://github.com/v2board/v2board.git
synced 2025-01-30 18:19:12 +08:00
docker-compose config
update readme update some file
This commit is contained in:
parent
710f454122
commit
3bc8f58a1b
@ -7,9 +7,9 @@ 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_DATABASE=v2board
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
|
||||
@ -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
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -7,7 +7,11 @@
|
||||
.env
|
||||
.env.backup
|
||||
.phpunit.result.cache
|
||||
.idea
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
composer.phar
|
||||
yarn.lock
|
||||
dbdata
|
||||
|
24
docker-compose.yml
Normal file
24
docker-compose.yml
Normal file
@ -0,0 +1,24 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
db:
|
||||
container_name: v2board-db
|
||||
image: mysql
|
||||
environment:
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=true
|
||||
volumes:
|
||||
- ./dbdata:/var/lib/mysql
|
||||
- ./install.sql:/install.sql
|
||||
backend:
|
||||
image: composer
|
||||
working_dir: /root/backend
|
||||
volumes:
|
||||
- .:/root/backend
|
||||
nginx:
|
||||
image: nginx
|
||||
volumes:
|
||||
- .:/root/backend
|
||||
- ./nginx:/etc/nginx/conf.d
|
||||
ports:
|
||||
- 8964:80
|
||||
|
4
init.sh
4
init.sh
@ -1,4 +1,2 @@
|
||||
wget https://getcomposer.org/download/1.9.0/composer.phar
|
||||
php composer install
|
||||
php artisan key:generate
|
||||
php artisan config:cache
|
||||
php artisan config:cache
|
||||
|
@ -2,6 +2,9 @@ SET NAMES utf8;
|
||||
SET time_zone = '+00:00';
|
||||
SET foreign_key_checks = 0;
|
||||
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
|
||||
DROP DATABASE IF EXISTS `v2board`;
|
||||
CREATE DATABASE `v2board`;
|
||||
USE `v2board`;
|
||||
|
||||
DROP TABLE IF EXISTS `v2_invite_code`;
|
||||
CREATE TABLE `v2_invite_code` (
|
||||
@ -121,4 +124,4 @@ CREATE TABLE `v2_user` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- 2019-10-22 15:50:47
|
||||
-- 2019-10-22 15:50:47
|
||||
|
3
nginx/backend.conf
Normal file
3
nginx/backend.conf
Normal file
@ -0,0 +1,3 @@
|
||||
server {
|
||||
|
||||
}
|
37
readme.md
37
readme.md
@ -1 +1,36 @@
|
||||
sh init.sh
|
||||
|
||||
## 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. 初始化项目
|
||||
> ```shell script
|
||||
> sh init.sh
|
||||
> ```
|
||||
>
|
||||
3. 从 `install.sql` 文件中恢复表
|
||||
|
||||
|
||||
### Docker 环境部署
|
||||
1. 初始化项目
|
||||
> ```shell script
|
||||
> docker-compose run --rm backend composer install
|
||||
> docker-compose run --rm backend sh init.sh
|
||||
> ```
|
||||
2. 进入 docker 容器从 `install.sql` 文件中恢复表
|
||||
3. 执行 `docker-compose up -d` 启动服务
|
||||
|
Loading…
Reference in New Issue
Block a user