Skip to content

Commit 8e8348e

Browse files
committed
✨Add Dockerfile and README
1 parent 0a17782 commit 8e8348e

File tree

5 files changed

+101
-1
lines changed

5 files changed

+101
-1
lines changed

.dockerignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/target
2+
# Created by https://www.toptal.com/developers/gitignore/api/rust
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=rust
4+
5+
### Rust ###
6+
# Generated by Cargo
7+
# will have compiled files and executables
8+
debug/
9+
target/
10+
11+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
12+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
13+
Cargo.lock
14+
15+
# These are backup files generated by rustfmt
16+
**/*.rs.bk
17+
18+
# MSVC Windows builds of rustc generate these, which store debugging information
19+
*.pdb
20+
21+
# End of https://www.toptal.com/developers/gitignore/api/rust
22+
n
23+
.env

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2021"
88
[dependencies]
99
hyper = { version = "0.14", features = ["full"] }
1010
tokio = { version = "1", features = ["full"] }
11-
rocket = "0.5.0-rc.2"
1211
reqwest = "0.11"
1312
lazy_static = "1.4.0"
1413
dotenv = "0.15.0"

Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM rust:1.51 as builder
2+
COPY . .
3+
RUN cargo build --release
4+
FROM debian:buster-slim
5+
COPY --from=builder /target/release/chatgpt-proxy-server /usr/local/bin/chatgpt-proxy-server
6+
EXPOSE 3000
7+
CMD ["chatgpt-proxy-server"]

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<h1 align="center">Welcome to chatgpt-proxy-server 👋</h1>
2+
<p>
3+
<img alt="Version" src="https://img.shields.io/badge/version-0.0.1-blue.svg?cacheSeconds=2592000" />
4+
<a href="https://twitter.com/fuergaosi" target="_blank">
5+
<img alt="Twitter: fuergaosi" src="https://img.shields.io/twitter/follow/fuergaosi.svg?style=social" />
6+
</a>
7+
</p>
8+
9+
> ChatGPT unofficial reverse proxy service
10+
11+
### [Demo](chat.y1s1.host)
12+
13+
## Usage
14+
15+
```sh
16+
cargo run
17+
```
18+
19+
## Author
20+
21+
* Twitter: [@fuergaosi](https://twitter.com/fuergaosi)
22+
* Github: [@fuergaosi233](https://github.com/fuergaosi233)
23+
24+
## Show your support
25+
26+
Give a ⭐️ if this project helped you!
27+
28+
***
29+
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

workflows/ci.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Chatgpt-proxy-server build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build-and-push-image:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Log in to the Container registry
24+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
38+
with:
39+
context: .
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)