Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
更新自述文件,劣化workflows功能
Browse files Browse the repository at this point in the history
  • Loading branch information
xianyu-one committed May 23, 2024
1 parent dfb060b commit 2f20dc1
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 6 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set timestamp
id: timestamp
run: echo "timestamp=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -34,7 +30,7 @@ jobs:
platforms: linux/arm64,linux/amd64
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/surveyking:latest
${{ secrets.DOCKERHUB_USERNAME }}/surveyking:${{ steps.timestamp.outputs.timestamp }}
${{ secrets.DOCKERHUB_USERNAME }}/surveyking:1.6.0
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
Expand Down
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,51 @@
# surveyking-docker

surveyking(卷王)容器化构建

## 快速开始

下载初始化脚本,并自动部署至当前文件夹

```shell
https://raw.githubusercontent.com/xianyu-one/surveyking-docker/main/setup.sh -O setup.sh
chmod +x setup.sh
bash setup.sh
```

## 手工部署

### 步骤 1:创建目录并下载必要文件
首先,打开终端并执行以下命令以创建必要的目录结构:

```shell
mkdir -p ./surveyking/mysql
mkdir ./surveyking/sql
cd ./surveyking
```

### 步骤 2:下载初始化 SQL 文件和 Docker Compose 文件
接下来,我们将下载初始化 MySQL 数据库所需的 SQL 文件和 Docker Compose 配置文件:

```shell
wget https://raw.githubusercontent.com/xianyu-one/surveyking-docker/main/sqls/init-mysql.sql -O sqls/init-mysql.sql
wget https://raw.githubusercontent.com/xianyu-one/surveyking-docker/main/docker-compose.yml.example -O docker-compose.yml
```

### 步骤 3:启动 Docker 容器

现在,我们将使用 Docker Compose 启动 SurveyKing 应用程序的容器。确保已经安装了 Docker 和 Docker Compose。执行以下命令:

```shell
docker-compose up -d
```

这将启动 SurveyKing 应用程序的容器,并且该应用程序应该已经在运行中。


### 创建一个


```yaml
version: '3'
services:
mysql:
image: mysql:8
Expand Down
44 changes: 44 additions & 0 deletions docker-compose.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
services:
mysql:
image: mysql:8
container_name: mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: surveyking
MYSQL_DATABASE: surveyking
volumes:
- ./mysql/conf:/etc/mysqul/conf.d
- ./mysql/data:/var/lib/mysql
- ./sqls:/docker-entrypoint-initdb.d
networks:
app_net:
ipv4_address: 10.20.52.20
surveyking:
image: mrxianyu/surveyking:latest
container_name: surveyking
restart: unless-stopped
environment:
MYSQL_USER: root
MYSQL_PASS: surveyking
DB_URL: jdbc:mysql://mysql:3306/surveyking
SERVER_PORT: 1991
volumes:
- ./files:/app/files
- ./logs:/app/logs
depends_on:
- mysql
networks:
app_net:
ipv4_address: 10.20.52.10

networks:
app_net:
driver: bridge
enable_ipv6: true
ipam:
driver: default
config:
- subnet: 10.20.52.0/24
gateway: 10.20.52.1
- subnet: FD00:1:1::/64
gateway: FD00:1:1::1
11 changes: 11 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

mkdir -p ./surveyking/mysql
mkdir ./surveyking/sql

cd ./surveyking

wget https://raw.githubusercontent.com/xianyu-one/surveyking-docker/main/sqls/init-mysql.sql -O sqls/init-mysql.sql
wget https://raw.githubusercontent.com/xianyu-one/surveyking-docker/main/docker-compose.yml.example -O docker-compose.yml

docker-compose up -d

0 comments on commit 2f20dc1

Please sign in to comment.