File size: 602 Bytes
06f23f8 db831f5 06f23f8 db831f5 06f23f8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | FROM python:3.9
# Create non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Clone the FastSD CPU repository
RUN git clone https://github.com/rupeshs/fastsdcpu.git .
# Install Python dependencies from cloned repo's requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Create results directory with proper permissions
RUN mkdir -p /app/results && chmod -R 775 /app/results
# Expose port for FastAPI server
EXPOSE 8000
# Command to run the FastAPI server
CMD ["python", "src/app.py", "--api"] |