Update Dockerfile
Browse files- Dockerfile +9 -4
Dockerfile
CHANGED
@@ -3,22 +3,27 @@ FROM python:3.8-slim-buster
|
|
3 |
ENV PYTHONUNBUFFERED=1 \
|
4 |
PYTHONDONTWRITEBYTECODE=1 \
|
5 |
PORT=7860 \
|
6 |
-
DATABASE_URL=sqlite
|
7 |
|
8 |
WORKDIR /app
|
9 |
|
|
|
10 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
11 |
gcc \
|
12 |
python3-dev \
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
|
15 |
COPY requirements.txt .
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
COPY . .
|
19 |
|
20 |
-
#
|
21 |
-
RUN python manage.py collectstatic --noinput
|
22 |
|
23 |
COPY entrypoint.sh /entrypoint.sh
|
24 |
RUN chmod +x /entrypoint.sh
|
|
|
3 |
ENV PYTHONUNBUFFERED=1 \
|
4 |
PYTHONDONTWRITEBYTECODE=1 \
|
5 |
PORT=7860 \
|
6 |
+
DATABASE_URL=sqlite:////data/db.sqlite3
|
7 |
|
8 |
WORKDIR /app
|
9 |
|
10 |
+
# Install system dependencies
|
11 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
12 |
gcc \
|
13 |
python3-dev \
|
14 |
+
curl \
|
15 |
+
libsqlite3-dev \
|
16 |
+
&& rm -rf /var/lib/apt/lists/* \
|
17 |
+
&& mkdir -p /data /static \
|
18 |
+
&& chmod 777 /data /static
|
19 |
|
20 |
COPY requirements.txt .
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
COPY . .
|
24 |
|
25 |
+
# Build-time static collection with dummy settings
|
26 |
+
RUN python manage.py collectstatic --noinput --settings=dtb.settings_build
|
27 |
|
28 |
COPY entrypoint.sh /entrypoint.sh
|
29 |
RUN chmod +x /entrypoint.sh
|