説明なし

Dockerfile 1.2KB

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