38086-vm/Dockerfile
2026-02-07 18:11:53 +00:00

34 lines
704 B
Docker

# Use official Python runtime as a parent image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install system dependencies required for mysqlclient
RUN apt-get update && apt-get install -y \
default-libmysqlclient-dev \
build-essential \
pkg-config \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# Set work directory
WORKDIR /app
# Install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy project
COPY . /app/
# Make entrypoint executable
RUN chmod +x /app/entrypoint.sh
# Expose port
EXPOSE 8000
# Define entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]