Skip to content

Commit

Permalink
support for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
fb0sh committed Mar 25, 2024
1 parent 8bebb30 commit 620c3e5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3'
services:
oblivion-rust:
build: .
container_name: oblivion-rust
ports:
- "7076:7076"
10 changes: 10 additions & 0 deletions rsproxy.config
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions ubuntu.list
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 620c3e5

Please sign in to comment.