20 lines
700 B
Docker
20 lines
700 B
Docker
FROM python:3.11-slim-bullseye
|
|
# Instalar dependencias del sistema y el Driver 17 de SQL Server
|
|
RUN apt-get update && apt-get install -y curl gnupg unixodbc unixodbc-dev \
|
|
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
|
|
&& curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \
|
|
&& apt-get update \
|
|
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
# Exponemos el puerto 8000 de FastAPI
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |