TC / Dockerfile
farwew's picture
Update Dockerfile
9c19644 verified
raw
history blame contribute delete
722 Bytes
# --- build image python ---
FROM python:3.11-slim
# set workdir
WORKDIR /app
# install dependencies system (pandas needs build deps; slim may need libpq, build-essential)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
gfortran \
libblas-dev \
liblapack-dev \
&& rm -rf /var/lib/apt/lists/*
# copy requirements and install
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# copy app code
COPY . /app
# environment variables (default CSV path can be overridden by docker run -e CSV_PATH=...)
ENV CSV_PATH=/app/generated_dummy_data.csv
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]