DuckDB-UI / Dockerfile
amaye15's picture
Deploy
b138bfa
raw
history blame
808 Bytes
# Dockerfile
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Create a non-root user and group
ARG UID=1000
ARG GID=1000
RUN groupadd -g ${GID} --system appgroup && useradd -u ${UID} -g appgroup --system appuser
WORKDIR /app
# Create data directory and set permissions
RUN mkdir /app/data && chown appuser:appgroup /app/data
# Copy requirements and install as root first (some packages might need it)
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code and set permissions
COPY . .
RUN chown -R appuser:appgroup /app
# Switch to the non-root user
USER appuser
EXPOSE 8000
# Run uvicorn as the non-root user
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]