Spaces:
Sleeping
Sleeping
File size: 982 Bytes
1a25b7f | 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 36 37 38 39 40 41 42 | # Stage 1: Build the Nuxt frontend natively inside the container
FROM node:20-slim AS builder
WORKDIR /build
# Copy only frontend requirements to leverage Docker cache
COPY frontend/package*.json ./
RUN npm install
# Copy frontend source files and compile
COPY frontend/ ./
RUN npm run build
# Stage 2: Final runtime image
FROM ldsprgrm/algovision-deps:latest
# Install Node.js and Git
RUN apt-get update && apt-get install -y curl git && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the natively built frontend output to the runtime stage
COPY --from=builder /build/.output /app/frontend-server
# Copy the bootloader script
COPY bootloader.sh .
RUN chmod +x bootloader.sh
# Set environment variables for ports and execution
ENV PYTHONPATH=/app
ENV PORT=7860
ENV NUXT_PORT=7860
ENV NUXT_HOST=0.0.0.0
EXPOSE 7860
# Run bootloader
ENTRYPOINT ["./bootloader.sh"]
|