-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.heroku
30 lines (23 loc) · 979 Bytes
/
Dockerfile.heroku
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
FROM python:3.9
# Set environment variables
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NOWARNINGS yes
# Set work directory in Docker container
WORKDIR /code
# Install system dependencies
RUN apt-get update && \
apt-get install -y postgresql-server-dev-all gcc python3-dev musl-dev libffi-dev nodejs npm ffmpeg --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY ./requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Install Protobuf python library from source
RUN curl -L https://raw.githubusercontent.com/protocolbuffers/protobuf/main/python/google/protobuf/internal/builder.py \
-o /usr/local/lib/python3.9/site-packages/google/protobuf/internal/builder.py
# Copy project files into the Docker image
COPY . .
# Run Django collectstatic
RUN python manage.py collectstatic --noinput --settings=main.settings.heroku