Migrate orders backend from Django to Express + Apollo Server
All checks were successful
Build Docker Image / build (push) Successful in 1m37s
All checks were successful
Build Docker Image / build (push) Successful in 1m37s
Replace Python/Django/Graphene stack with TypeScript/Express/Apollo Server. Same 3 GraphQL endpoints (public/user/team), same JWT auth via Logto JWKS, same Odoo proxy logic. No database needed (pure proxy).
This commit is contained in:
31
Dockerfile
31
Dockerfile
@@ -1,24 +1,23 @@
|
||||
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 tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
COPY . .
|
||||
FROM node:22-alpine
|
||||
|
||||
RUN pip install --no-cache-dir poetry==$NIXPACKS_POETRY_VERSION \
|
||||
&& poetry install --no-interaction --no-ansi
|
||||
WORKDIR /app
|
||||
|
||||
ENV PORT=8000
|
||||
COPY package.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
CMD ["sh", "-c", "poetry run python manage.py migrate && poetry run python manage.py collectstatic --noinput && poetry run python -m gunicorn orders.wsgi:application --bind 0.0.0.0:${PORT:-8000}"]
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["node", "dist/index.js"]
|
||||
|
||||
Reference in New Issue
Block a user