Keine Beschreibung

Dockerfile 1.4KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Use a Debian release that is supported by the Microsoft SQL Server ODBC repo.
  2. FROM python:3.10-slim-bookworm
  3. ENV PYTHONUNBUFFERED=1
  4. # Install system dependencies for MS SQL ODBC (comment out if not using MSSQL)
  5. # Install system dependencies for MS SQL ODBC and command-line tools
  6. RUN apt-get update && apt-get install -y curl gnupg apt-transport-https ca-certificates \
  7. && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc \
  8. | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \
  9. && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/debian/12/prod bookworm main" \
  10. > /etc/apt/sources.list.d/mssql-release.list \
  11. && apt-get update && ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools18 unixodbc-dev \
  12. && echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc \
  13. && apt-get clean && rm -rf /var/lib/apt/lists/*
  14. RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
  15. && apt-get install -y nodejs \
  16. && npm install -g yarn
  17. # Set the working directory
  18. WORKDIR /app
  19. # Copy requirements and install Python dependencies
  20. COPY requirements.txt .
  21. RUN pip install --no-cache-dir -r requirements.txt
  22. # Copy the Django project (app/ folder) into the container
  23. COPY app/ /app/
  24. # Expose Django's default port
  25. EXPOSE 8000
  26. # Default command: run Django's development server
  27. CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]