Spaces:
Build error
Build error
File size: 1,026 Bytes
8889a76 |
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 |
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Checks all images
ENV DOCKER_CONTENT_TRUST = 1
# Labels
LABEL version = "1.0.0"
# Set the working directory
WORKDIR OpenAI
# Create volume directory
RUN mkdir -p /docker/data
# Python should not write bytecode files (.pyc files) to disk.
ENV PYTHONDONTWRITEBYTECODE 1
# Disables buffering, allowing the output to be immediately displayed as it is generated.
ENV PYTHONUNBUFFERED 1
# Installs Nano and Curl
RUN apt-get update \
&& apt-get install -y curl \
&& apt-get -y install nano \
&& apt-get clean
# Copy the requirements file into the container
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip3 install --trusted-host pypi.python.org -r requirements.txt
# Set environment variables
ARG OPEN_AI_KEY
ENV OPEN_AI_KEY=${OPEN_AI_KEY}
# Copy the rest of the application code
COPY . .
# Run the command to start the app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
|