forked from coldfront/coldfront
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathContainerfile.debugpy
More file actions
57 lines (44 loc) · 1.65 KB
/
Containerfile.debugpy
File metadata and controls
57 lines (44 loc) · 1.65 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
########################
# 1) Frontend build stage
########################
FROM node:24-alpine AS frontend
WORKDIR /app
# Copy only npm manifests first for caching
COPY coldfront/static/package.json coldfront/static/package-lock.json ./coldfront/static/
WORKDIR /app/coldfront/static
RUN npm ci
# Copy the rest of the frontend sources
COPY coldfront/static ./
# Build (should output bundles + manifest)
RUN npm run build
########################
# 2) Final stage
########################
FROM python:3.12-slim-trixie
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project
COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --extra prod --dev
# Copy built bundles/manifest from frontend stage into the backend image
COPY --from=frontend /app/coldfront/static/bundles /app/coldfront/static/bundles
ENV DEBUG=True
ENV PYTHONUNBUFFERED=1
ENV PLUGIN_SLURM=True
ENV PLUGIN_XDMOD=True
ENV PLUGIN_API=True
ENV EMAIL_ENABLED=True
ENV XDMOD_API_URL="localhost"
EXPOSE 8000
EXPOSE 5678
RUN echo "yes" | uv run manage.py initial_setup
RUN uv run manage.py load_test_data
CMD ["uv", "run", "python3", "-m", "debugpy", "--listen", "0.0.0.0:5678", "-m", "gunicorn", "-w", "1", "--capture-output","--enable-stdio-inheritance", "coldfront.config.wsgi","--bind", "0.0.0.0:8000", "--timeout", "0"]