Spaces:
Sleeping
Sleeping
File size: 874 Bytes
c9f9088 6efa217 c9f9088 6efa217 c9f9088 6efa217 c9f9088 6efa217 c9f9088 6efa217 c9f9088 6efa217 c9f9088 6efa217 c9f9088 6efa217 c9f9088 6efa217 c9f9088 |
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 |
FROM python:3.13-slim
# Install Node.js and npm
RUN apt-get update && apt-get install -y \
curl \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy backend requirements
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ ./backend/
COPY aimakerspace/ ./aimakerspace/
# Copy frontend code
COPY frontend/ ./frontend/
# Install frontend dependencies and build
WORKDIR /app/frontend
RUN npm install
RUN npm run build
# Set environment variables
ENV OPENAI_API_KEY=${OPENAI_API_KEY}
ENV PORT=7860
# Expose port
EXPOSE 7860
# Start both backend and frontend
WORKDIR /app
CMD ["sh", "-c", "cd backend && uvicorn main:app --host 0.0.0.0 --port 7860"] |