-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (41 loc) · 1.26 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
50
FROM python:3.12-slim-buster
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Set environment variables
ENV POETRY_VIRTUALENVS_CREATE=0
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV LANGUAGE en_US:en
ENV LANG en_US.UTF-8
# Set work directory
WORKDIR /src
# Update and install system-level dependencies
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
chromium \
curl \
gettext \
git \
libpq-dev \
unzip \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js (for Tailwind support)
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install application-level dependencies
RUN pip install --no-cache-dir poetry==1.6.2
COPY pyproject.toml poetry.lock /src/
RUN poetry install --no-root
# Copy project files over to image
COPY . /src/
# Prepare static files for Heroku deployment
RUN python manage.py tailwind install --no-input
RUN python manage.py tailwind build --no-input
RUN python manage.py collectstatic --noinput
# Expose 8000 port in container for API use
EXPOSE 8000