Migrate billing backend from Django to Express + Apollo Server + Prisma
All checks were successful
Build Docker Image / build (push) Successful in 1m44s

Replace Python/Django/Graphene with TypeScript/Express/Apollo Server.
Same 2 endpoints (team/m2m), same JWT auth, same TigerBeetle integration.
Prisma ORM replaces Django ORM for Account/OperationCode/ServiceAccount.
This commit is contained in:
Ruslan Bakiev
2026-03-09 09:13:07 +07:00
parent 5ce3acf8b0
commit 2d96afabec
49 changed files with 4356 additions and 2968 deletions

View File

@@ -1,24 +1,28 @@
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
NIXPACKS_POETRY_VERSION=2.2.1
FROM node:22-alpine AS builder
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential curl \
&& rm -rf /var/lib/apt/lists/*
COPY package.json ./
RUN npm install
RUN python -m venv --copies /opt/venv
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY prisma ./prisma
RUN npx prisma generate
COPY . .
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
RUN pip install --no-cache-dir poetry==$NIXPACKS_POETRY_VERSION \
&& poetry install --no-interaction --no-ansi
FROM node:22-alpine
ENV PORT=8000
WORKDIR /app
CMD ["sh", "-c", "poetry run python manage.py migrate && poetry run python manage.py collectstatic --noinput && poetry run python -m gunicorn billing.wsgi:application --bind 0.0.0.0:${PORT:-8000}"]
COPY package.json ./
RUN npm install --omit=dev
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/dist ./dist
COPY prisma ./prisma
EXPOSE 8000
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/index.js"]