Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
# Use the official Python image as the base image
FROM python:3.9
# Base image
FROM python:3.9-bullseye

# Set the working directory in the container
# Working directory
WORKDIR /app

# Copy the application files into the container
# Install required system packages
RUN apt-get update && apt-get install -y \
curl \
gnupg2 \
unixodbc \
unixodbc-dev \
apt-transport-https \
ca-certificates

# Add Microsoft GPG key
RUN curl https://packages.microsoft.com/keys/microsoft.asc | \
gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg

# Add Microsoft SQL repository
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/11/prod bullseye main" \
> /etc/apt/sources.list.d/mssql-release.list

# Install ODBC Driver 18
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql18

# Copy project files
COPY . .

# Install necessary packages
RUN apt-get update && apt-get install -y unixodbc unixodbc-dev
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql17
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

RUN pip install -r requirements.txt
# Expose application port
EXPOSE 8000

# Start the FastAPI application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
# Start FastAPI app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]