content: FROM node:20-alpine AS frontend  
  RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
  
  WORKDIR /home/node/app 
  COPY ./frontend/package*.json ./  
  USER node
  RUN npm ci  
  COPY --chown=node:node ./frontend/ ./frontend  
  COPY --chown=node:node ./static/ ./static  
  WORKDIR /home/node/app/frontend
  RUN npm run build
    
  FROM python:3.11-alpine 
  RUN apk add --no-cache --virtual .build-deps \  
      build-base \  
      libffi-dev \  
      openssl-dev \  
      curl \  
      && apk add --no-cache \  
      libpq \  
      && pip install --no-cache-dir uwsgi  
    
  COPY requirements.txt /usr/src/app/  
  RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt \  
      && rm -rf /root/.cache  
    
  COPY . /usr/src/app/  
  COPY --from=frontend /home/node/app/static  /usr/src/app/static/
  WORKDIR /usr/src/app  
  ENV UWSGI_PROCESSES=2
  ENV UWSGI_THREADS=1
  EXPOSE 80  
  CMD uwsgi --processes $UWSGI_PROCESSES --threads $UWSGI_THREADS --http :80 --wsgi-file app.py --callable app -b 32768