-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (17 loc) · 712 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (17 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use the official Python image from the Docker Hub
FROM python:3.12-alpine
# Set environment variables to prevent Python from writing .pyc files and buffering stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set the working directory in the container
WORKDIR /app
# Install OS package dependencies
RUN apk add --no-cache mariadb-dev
# Copy the requirements file to the container
COPY requirements.txt /app/
# Install the Python dependencies
RUN apk add --no-cache --virtual build-deps gcc python3-dev musl-dev && \
pip install --no-cache-dir -r requirements.txt && \
apk del build-deps gcc python3-dev musl-dev
# Copy the entire Django project into the container
COPY . /app/