-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
50 lines (39 loc) · 1.1 KB
/
Dockerfile.prod
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
50
FROM python:3.11
# Set environment variables
ENV PYTHONUNBUFFERED 1
# Create and set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
python3-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev \
libsasl2-dev \
libldap2-dev \
libssl-dev \
libffi-dev \
default-libmysqlclient-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
liblcms2-dev \
libblas-dev \
libatlas-base-dev \
&& rm -rf /var/lib/apt/lists/*
# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.prod.txt .
RUN pip install -r requirements.prod.txt
# Copy the rest of the application code to the container
COPY . /app/
# Make migrations, migrate, populate db and collect static files for production
RUN sed -i 's/\r$//g' /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Expose the port the app runs on
EXPOSE 8000
# Set the entrypoint script
ENTRYPOINT ["/app/entrypoint.sh"]
# Start Gunicorn server for production
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "toolbox.wsgi:application"]