FileTransfer / Dockerfile
ZeroTraceX's picture
Update Dockerfile
a30fdbb verified
raw
history blame
763 Bytes
# Use Python 3.10 slim image as base
FROM python:3.10-slim
# Create non-root user
RUN useradd -m -u 1000 user
RUN apt-get update && apt-get install -y git
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PORT=7860
# Create and set working directory
WORKDIR $HOME/app
# Clone the repository and move files without creating an extra folder
RUN git clone https://github.com/charan200415/FileToLink temp && \
shopt -s dotglob && \
mv temp/* ./ && \
rmdir temp
# Switch to non-root user
USER user
# Install dependencies
RUN pip install --user -r requirements.txt
# Expose port
EXPOSE ${PORT}
# Command to run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]