whisperdocker / Dockerfile
lyimo's picture
Update Dockerfile
eef30c9 verified
raw
history blame
827 Bytes
FROM python:3.9
# Set up working directory and install dependencies
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Create a new user and set permissions
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
HF_HOME=/home/user/.cache/huggingface \
OPENAI_API_KEY=your_openai_api_key_here
WORKDIR $HOME/app
# Copy the rest of the application code into the container
COPY --chown=user . $HOME/app
# Ensure the cache directory has proper permissions
RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
# Expose the port the app runs on
EXPOSE 8000
# Install hypercorn
RUN pip install hypercorn
# Run the application using hypercorn
CMD ["hypercorn", "main:app", "--bind", "0.0.0.0:8000"]