Skip to content

Commit

Permalink
Merge pull request #7 from gpt-hey/docker
Browse files Browse the repository at this point in the history
Docker
  • Loading branch information
guanw authored Dec 9, 2023
2 parents 1132a16 + d1b47d5 commit 648b231
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ venv/**
**/**.log
**/**.pid
**.so
**.DS_Store
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install essential tools and Python
RUN apt-get update && \
apt-get install -y build-essential cmake gcc g++

# Install any needed packages specified in requirements.txt
RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r requirements.txt

# Make port 80 available to the world outside this container
EXPOSE 8081

# Define environment variable
# ENV NAME World

# Run app.py when the container launches
CMD ["python3", "./server/websocket_server.py"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ $ pip install -r requirements.txt
$ supervisord -c supervisord.conf
```

## docker
```
$docker build -t gpt_python_server:1.0 .
$docker run -p 8081:8081 gpt_python_server:1.0
// in case need to debug docker container
$docker docker exec -it <container-id> /bin/bash
```



## prompt examples

// 1. ask server to set up reminder
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ numpy
langchain
faiss-cpu
websockets
supervisor
supervisor
llama-cpp-python
sentence-transformers

0 comments on commit 648b231

Please sign in to comment.