You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
2.2 KiB
52 lines
2.2 KiB
# This is a basic Dockerfile and might need to be adjusted according to your specific application's needs. Please replace the placeholders for environment variables with your actual keys. Also, remember not to expose sensitive data like API keys in your Dockerfile or any version control systems.
|
|
|
|
# When building and running this Docker container, be sure to allocate enough resources (especially GPU memory) for your chosen visual foundation model if running on a machine with an NVIDIA GPU. You may need to use nvidia-docker or Docker's --gpus option when running the container. The GPU memory usage you provided would be valuable for this purpose.
|
|
|
|
# It's important to note that Docker inherently does not fully support GPUs. As a result, running GPU-accelerated code within Docker requires a special runtime like NVIDIA Docker. For more complex orchestration, a platform like Kubernetes can be more effective.
|
|
|
|
# Lastly, since your application seems to be using Redis (CELERY_BROKER_URL), you might need to set up a separate Redis service as well. This can be accomplished by creating a multi-container Docker application using Docker Compose or Kubernetes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Use an official Python runtime as a parent image
|
|
FROM python:3.9-slim-buster
|
|
|
|
# Set environment variables
|
|
ENV EVAL_PORT=8000 \
|
|
MODEL_NAME=gpt-4 \
|
|
CELERY_BROKER_URL=redis://localhost:6379 \
|
|
SERVER=http://localhost:${EVAL_PORT} \
|
|
USE_GPU=False \
|
|
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
|
|
|
|
# Set work directory
|
|
WORKDIR /usr/src/app
|
|
|
|
# Add requirements file
|
|
COPY requirements.txt ./
|
|
|
|
# Install any needed packages specified in requirements.txt
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Bundle app source
|
|
COPY . .
|
|
|
|
# Expose port
|
|
EXPOSE ${EVAL_PORT}
|
|
|
|
# Run example.py when the container launches
|
|
# Run the application
|
|
CMD ["python3.10", "-m", "api.main", "serve"]
|