Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasy-peak committed Aug 4, 2023
1 parent 67068d5 commit 3ac4c83
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 9 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Linux

on: [push, pull_request]
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]

jobs:
build:
Expand All @@ -11,11 +15,6 @@ jobs:
os: [ubuntu-22.04]

steps:
# - uses: actions/checkout@v1
# - uses: xmake-io/github-action-setup-xmake@v1
# with:
# xmake-version: branch@master
# actions-cache-folder: '.xmake-cache'
- name: Installation
run: |
sudo apt-get update
Expand All @@ -35,5 +34,16 @@ jobs:
source ~/.xmake/profile
xmake build -y
xmake install -o .
cd bin
ldd cpp-freegpt-webui
ldd ./bin/cpp-freegpt-webui
- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build the Docker image
run: |
pwd
ls
docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:latest
- name: Docker image push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:latest
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:22.04

WORKDIR /app

ADD bin /app/bin
ADD cfg /app/cfg
ADD client /app/client

RUN ls /app/bin
RUN ls /app/cfg

WORKDIR /app/bin

ENTRYPOINT ["sh", "-c", "./cpp-freegpt-webui ../cfg/cpp-free-gpt.yml"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ Access the application in your browser using the URL:
```
http://127.0.0.1:8085/chat
```

### Running the Docker
Pull the Docker image from Docker Hub:
```
docker pull fantasypeak/freegpt:latest
```

Run the application using Docker:
```
docker run --net=host -it --name freegpt fantasypeak/freegpt:latest
// OR
docker run -p 8858:8858 -it --name freegpt fantasypeak/freegpt:latest
```

### WebUI
The application interface was incorporated from the [chatgpt-clone](https://github.com/xtekky/chatgpt-clone) repository.

Expand Down
2 changes: 1 addition & 1 deletion include/cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct Config {
std::size_t interval{300};
std::size_t work_thread_num{8};
std::size_t max_http_client_num{2};
std::string host{"127.0.0.1"};
std::string host{"0.0.0.0"};
std::string port{"8858"};
std::string chat_path{"/chat"};
std::vector<std::string> providers;
Expand Down

0 comments on commit 3ac4c83

Please sign in to comment.