-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (32 loc) · 989 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libmariadb-dev \
libcairo2-dev \
pkg-config \
libdbus-1-dev \
libgirepository1.0-dev \
libcairo2-dev \
gir1.2-glib-2.0 \
&& rm -rf /var/lib/apt/lists/*
# Copy the current directory contents into the container at /app
COPY . /app/
# Install any needed packages specified in requirements.txt
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN apt-get update && apt-get install -y \
build-essential \
libmariadb-dev \
pkg-config \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# Make port 8000 available to the world outside this container
EXPOSE 8000
# Define environment variable
ENV PYTHONUNBUFFERED=1
# Run the Django server when the container launches
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]