diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c66024d..1aa81e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: push jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Check out Git repository uses: actions/checkout@v2 @@ -42,7 +42,9 @@ jobs: args: --bin server --release - name: Run - run: ./script/run_on_ci.sh + run: + chmod +x ./target/release/server + ./script/run_on_ci.sh - name: Archive debug artifacts uses: actions/upload-artifact@v2 @@ -53,4 +55,7 @@ jobs: server/templates static/ Rocket.toml + DEPLOY.md + Dockerfile + docker-compose.yml !static/.gitignore diff --git a/DEPLOY.md b/DEPLOY.md new file mode 100644 index 0000000..c1b65ac --- /dev/null +++ b/DEPLOY.md @@ -0,0 +1,20 @@ +# Setup +```shell +unzip build.zip -d ./bard +mkdir store +cd bard +``` + +# Build +docker build -t bard:1 . + +# Run +docker-compose up -d + +# Debug +https://www.runoob.com/docker/docker-mirror-acceleration.html + +Ubuntu14.04、Debian7Wheezy +对于使用 upstart 的系统而言,编辑 /etc/default/docker 文件,在其中的 DOCKER_OPTS 中配置加速器地址: + +DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com" diff --git a/Dockerfile b/Dockerfile index de7f2f7..7a6c3ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update -y && apt-get upgrade -y RUN apt-get install -y libsqlite3-dev WORKDIR /opt/app diff --git a/docker-compose.yml b/docker-compose.yml index 09c9d4f..93c11b4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,6 @@ bard: image: bard:1 volumes: - .:/opt/app - - ./store:/opt/app/store + - ../store:/opt/app/store ports: - "8001:8000"