-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 1.2 KB
/
Dockerfile
File metadata and controls
41 lines (31 loc) · 1.2 KB
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
FROM python:3.14-slim
ARG ASTRA_BUILD_SHA=""
ENV ASTRA_BUILD_SHA=$ASTRA_BUILD_SHA
# Install system dependencies for Postgres, Pillow, and in-container JS execution tests.
RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
libpq-dev \
libjpeg-dev \
zlib1g-dev \
tzdata-legacy \
git \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app/astra_app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Keep entrypoint outside the bind-mounted /app volume (devcontainers/compose)
COPY docker/entrypoint.sh /usr/local/bin/astra-entrypoint
COPY docker/migrate.sh /usr/local/bin/migrate.sh
RUN chmod +x /usr/local/bin/astra-entrypoint /usr/local/bin/migrate.sh
COPY . .
RUN cd frontend && npm ci && npm run build
# Collect static files for production.
# This intentionally runs at build time so the runtime container can serve
# `/static/` via WhiteNoise without requiring any writable volume.
RUN cd astra_app && python manage.py collectstatic --noinput
EXPOSE 8000
ENTRYPOINT ["/usr/local/bin/astra-entrypoint"]
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000", "--config", "/app/astra_app/gunicorn.conf.py"]