34 lines
678 B
Docker
34 lines
678 B
Docker
FROM node:24-bookworm-slim AS frontend-deps
|
|
|
|
WORKDIR /app/frontend
|
|
|
|
COPY frontend/package*.json ./
|
|
RUN npm ci
|
|
|
|
FROM frontend-deps AS frontend-builder
|
|
|
|
COPY frontend ./
|
|
RUN npm run build
|
|
|
|
FROM python:3.12-slim-bookworm
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN addgroup --system django \
|
|
&& adduser --system --ingroup django django
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY --chown=django:django . .
|
|
COPY --from=frontend-builder --chown=django:django /app/showcase/static/showcase/dist ./showcase/static/showcase/dist
|
|
|
|
USER django
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|