
Introduced Dockerfiles for logistics and frontend applications to streamline development and deployment. Updated package dependencies in the frontend to newer versions for improved stability and compatibility.
41 lines
1.2 KiB
Docker
41 lines
1.2 KiB
Docker
FROM python:3.12-slim-bullseye
|
|
# Use the Debian 11 base image
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
unixodbc-dev \
|
|
libmariadb-dev \
|
|
libssl-dev \
|
|
gcc \
|
|
curl \
|
|
gpg && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Download and install the msodbcsql18 driver for arm64-compatible base image
|
|
RUN apt-get update && apt-get install -y --no-install-recommends unixodbc-dev curl apt-transport-https gnupg && \
|
|
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \
|
|
curl -sSL https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
|
|
apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc
|
|
|
|
|
|
# Install pyodbc
|
|
RUN pip install pyodbc
|
|
|
|
# Copy the requirements file
|
|
COPY requirements.txt /app/requirements.txt
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of the application code
|
|
COPY . /app
|
|
|
|
# Expose the application port
|
|
EXPOSE 8000
|
|
|
|
# Command to run the application
|
|
CMD ["python", "main.py"] |