Skip to content

Commit

Permalink
very slow version of docker works
Browse files Browse the repository at this point in the history
  • Loading branch information
guanw committed Dec 9, 2023
1 parent d280068 commit d1b47d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
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
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# Use an official Python runtime as a parent image
FROM python:3.8-slim
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 pip install --no-cache-dir -r 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
# ENV NAME World

# Run app.py when the container launches
CMD ["python", "./server/websocket_server.py"]
CMD ["python3", "./server/websocket_server.py"]
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ $ supervisord -c supervisord.conf

## docker
```
$docker build -t gpt_python_server .
$docker run -p 8081:8081 gpt_python_server
$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
```

Expand Down

0 comments on commit d1b47d5

Please sign in to comment.