File size: 1,470 Bytes
4962437
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Use an official Python runtime as a parent image
FROM nvidia/cuda:11.7.0-runtime-ubuntu20.04

# Set environment variables
ENV EVAL_PORT=8000 \
    MODEL_NAME=gpt-4 \
    CELERY_BROKER_URL=redis://localhost:6379 \
    SERVER=http://localhost:${EVAL_PORT} \
    USE_GPU=True \
    PLAYGROUND_DIR=playground \
    LOG_LEVEL=INFO \
    BOT_NAME=Orca \
    # You will need to set these environment variables to your actual keys in production
    OPENAI_API_KEY=your_openai_api_key \
    WINEDB_HOST=your_winedb_host \
    WINEDB_PASSWORD=your_winedb_password \
    BING_SEARCH_URL=your_bing_search_url \
    BING_SUBSCRIPTION_KEY=your_bing_subscription_key \
    SERPAPI_API_KEY=your_serpapi_api_key \
    REDIS_HOST=your_redis_host \
    REDIS_PORT=your_redis_port

# Set work directory
WORKDIR /usr/src/app

# Install system dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
    apt-get install -y software-properties-common && \
    add-apt-repository ppa:deadsnakes/ppa && \
    apt-get install -y python3.10 python3-pip curl && \
    apt-get install -y nodejs npm

# Add requirements file
COPY requirements.txt ./

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

# Bundle app source
COPY . .

# Expose port
EXPOSE ${EVAL_PORT}

# Run the application
CMD ["uvicorn", "api.app:app", "--host", "0.0.0.0", "--port", "8000"]