TwitterAdvanc / Dockerfile
Ankit Singh
First commit
d7b4429
raw
history blame contribute delete
450 Bytes
FROM python:3.9-slim
WORKDIR /code
# Create data directory and set permissions
RUN mkdir -p /data && \
chmod 777 /data && \
chown nobody:nogroup /data
# Install requirements
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application code
COPY ./app.py /code/app.py
# Switch to non-root user
USER nobody
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]