sshx / Dockerfile
xdragxt's picture
Update Dockerfile
afc8dd6 verified
raw
history blame
545 Bytes
FROM python:3.10
# Create non-root user
RUN useradd -m -u 1000 user
USER root
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Install Python dependencies
COPY ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy project files
COPY . /app
# Create startup script
RUN echo '#!/bin/bash\n' \
'exec uvicorn main:app --host 0.0.0.0 --port 7860' \
> /app/start.sh && chmod +x /app/start.sh
# Use non-root user
USER user
# Run app
CMD ["bash", "start.sh"]