BlessedRemzy's picture
cockroach db cert
80538f6
raw
history blame contribute delete
639 Bytes
FROM python:3.10-slim
RUN apt-get update && apt-get install -y \
build-essential \
gcc \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user (HF Spaces security best practice)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
RUN curl --create-dirs -o $HOME/.postgresql/root.crt 'https://cockroachlabs.cloud/clusters/4304f956-79f3-4da9-adc9-fe8dad68fed2/cert'
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
COPY --chown=user:user . .
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]