Wetemp / Dockerfile
Akwbw's picture
Update Dockerfile
2cd82ba verified
raw
history blame contribute delete
558 Bytes
# Use Python instead of Node
FROM python:3.9
# Set working directory
WORKDIR /code
# Copy requirements and install
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the app code
COPY ./app.py /code/app.py
# Create a user to avoid permission errors
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Open Port
WORKDIR /code
EXPOSE 7860
# Start the API (Uvicorn server)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]