-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (38 loc) · 1 KB
/
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
46
47
48
49
# Use the official Python image from the Docker Hub
# FROM python:3.6.8-alpine
FROM python:3.9-alpine
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install build dependencies
RUN apk update && apk add --no-cache \
build-base \
gcc \
musl-dev \
postgresql-dev \
jpeg-dev \
zlib-dev \
libjpeg \
libwebp-dev \
tiff-dev \
freetype-dev \
lcms2-dev \
openjpeg-dev \
libpng-dev \
libxslt-dev \
libxml2-dev
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container
COPY requirements.txt /app/
# Install the dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt
# Copy the entire Django project into the container
COPY . /app/
# Collect static files
# RUN python manage.py collectstatic --noinput
# Expose the port the app runs on
EXPOSE 8001
# Command to run the Django development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8001"]