From 620c3e508f5db32da80fd5989afec36cb05d7d30 Mon Sep 17 00:00:00 2001 From: FreetBash <3141495167@qq.com> Date: Mon, 25 Mar 2024 13:17:31 +0800 Subject: [PATCH] support for docker --- Dockerfile | 8 ++++++++ README.md | 5 +++++ docker-compose.yml | 7 +++++++ rsproxy.config | 10 ++++++++++ ubuntu.list | 15 +++++++++++++++ 5 files changed, 45 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 rsproxy.config create mode 100644 ubuntu.list diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e9741a2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:22.04 +RUN mkdir /root/.cargo +COPY ./ /root/oblivion-rust +COPY ./rsproxy.config /root/.cargo/config +COPY ./ubuntu.list /etc/apt/source.list +RUN apt-get update && apt-get install -y rustc cargo +WORKDIR /root/oblivion-rust +ENTRYPOINT ["cargo", "run", "--release"] diff --git a/README.md b/README.md index 45e52a3..d6dad13 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,8 @@ You can use the following command to create `Oblivion` documents: ```bash cargo doc -r ``` + +## Docker && docker-compose +```bash +docker-compose up -d +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..979b754 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3' +services: + oblivion-rust: + build: . + container_name: oblivion-rust + ports: + - "7076:7076" diff --git a/rsproxy.config b/rsproxy.config new file mode 100644 index 0000000..e5ab562 --- /dev/null +++ b/rsproxy.config @@ -0,0 +1,10 @@ +[source.crates-io] +replace-with = 'rsproxy-sparse' +[source.rsproxy] +registry = "https://rsproxy.cn/crates.io-index" +[source.rsproxy-sparse] +registry = "sparse+https://rsproxy.cn/index/" +[registries.rsproxy] +index = "https://rsproxy.cn/crates.io-index" +[net] +git-fetch-with-cli = true diff --git a/ubuntu.list b/ubuntu.list new file mode 100644 index 0000000..b215e30 --- /dev/null +++ b/ubuntu.list @@ -0,0 +1,15 @@ +deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse +deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse + +deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse +deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse + +deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse +deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse + +# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse +# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse + +deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse +deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse +