Spaces:
Sleeping
Sleeping
File size: 754 Bytes
ec3ccb2 343b64b ec3ccb2 343b64b ec3ccb2 343b64b ec3ccb2 343b64b ec3ccb2 87d3d61 ec3ccb2 87d3d61 ec3ccb2 343b64b ec3ccb2 cc0f83e ec3ccb2 cc0f83e |
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 |
FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY . .
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
RUN npm run build
FROM python:3.10-slim AS backend
WORKDIR /app
RUN useradd -m -u 1000 user
COPY ./requirements.txt .
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --from=builder /app/dist ./static
COPY . .
CMD ["python", "app.py"]
|