-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (35 loc) · 1010 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
40
41
42
43
44
45
# Base image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
cmake \
build-essential \
libopenblas-dev \
liblapack-dev \
libx11-dev \
libgtk-3-dev \
libboost-python-dev \
libboost-thread-dev \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy the Django project files into the container
COPY . /app/
# Expose the port the app runs on
EXPOSE 8000
# Run migrations and collect static files
RUN python manage.py migrate
RUN python manage.py collectstatic --noinput
# Run unit tests for models and forms
RUN python manage.py test
# Set environment variable for Sentry DSN
ENV SENTRY_DSN=${SENTRY_DSN}
# Run the Django development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]