alindor-hm / Dockerfile
shivakerur99's picture
Create Dockerfile
e30f8a4 verified
raw
history blame contribute delete
No virus
720 Bytes
FROM python:3.9
# Install ffmpeg
RUN apt-get update && \
apt-get install -y ffmpeg && \
rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /code
# Copy requirements file
COPY ./requirements.txt /code/requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Create a non-root user
RUN useradd -m -u 1000 user
# Switch to the non-root user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set working directory for the user
WORKDIR $HOME/app
# Copy application code
COPY --chown=user . $HOME/app
# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]