Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- Dockerfile +2 -3
- Dockerfile.hf +1 -1
- start.sh +2 -1
Dockerfile
CHANGED
|
@@ -32,7 +32,7 @@ RUN npm install -g serve
|
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
# Copy built frontend from frontend-build stage
|
| 35 |
-
COPY --from=frontend-build /app/dist ./frontend
|
| 36 |
|
| 37 |
# Setup backend
|
| 38 |
COPY --from=backend-build /app ./backend
|
|
@@ -41,9 +41,8 @@ COPY --from=backend-build /app ./backend
|
|
| 41 |
COPY start.sh .
|
| 42 |
RUN chmod +x start.sh
|
| 43 |
|
| 44 |
-
# Expose
|
| 45 |
EXPOSE 8501
|
| 46 |
-
EXPOSE 3000
|
| 47 |
|
| 48 |
# Start both services
|
| 49 |
CMD ["./start.sh"]
|
|
|
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
# Copy built frontend from frontend-build stage
|
| 35 |
+
COPY --from=frontend-build /app/dist ./frontend/dist
|
| 36 |
|
| 37 |
# Setup backend
|
| 38 |
COPY --from=backend-build /app ./backend
|
|
|
|
| 41 |
COPY start.sh .
|
| 42 |
RUN chmod +x start.sh
|
| 43 |
|
| 44 |
+
# Expose the port that Hugging Face Spaces expects
|
| 45 |
EXPOSE 8501
|
|
|
|
| 46 |
|
| 47 |
# Start both services
|
| 48 |
CMD ["./start.sh"]
|
Dockerfile.hf
CHANGED
|
@@ -32,7 +32,7 @@ RUN npm install -g serve
|
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
# Copy built frontend from frontend-build stage
|
| 35 |
-
COPY --from=frontend-build /app/dist ./frontend
|
| 36 |
|
| 37 |
# Setup backend
|
| 38 |
COPY --from=backend-build /app ./backend
|
|
|
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
# Copy built frontend from frontend-build stage
|
| 35 |
+
COPY --from=frontend-build /app/dist ./frontend/dist
|
| 36 |
|
| 37 |
# Setup backend
|
| 38 |
COPY --from=backend-build /app ./backend
|
start.sh
CHANGED
|
@@ -7,10 +7,11 @@ export PORT=8501
|
|
| 7 |
echo "Starting backend server on port 3000..."
|
| 8 |
cd backend
|
| 9 |
PORT=3000 npm start &
|
|
|
|
| 10 |
|
| 11 |
# Wait a moment for the backend to start
|
| 12 |
sleep 5
|
| 13 |
|
| 14 |
# Serve the frontend build
|
| 15 |
echo "Serving frontend on port $PORT..."
|
| 16 |
-
serve -s frontend
|
|
|
|
| 7 |
echo "Starting backend server on port 3000..."
|
| 8 |
cd backend
|
| 9 |
PORT=3000 npm start &
|
| 10 |
+
cd ..
|
| 11 |
|
| 12 |
# Wait a moment for the backend to start
|
| 13 |
sleep 5
|
| 14 |
|
| 15 |
# Serve the frontend build
|
| 16 |
echo "Serving frontend on port $PORT..."
|
| 17 |
+
serve -s frontend/dist -l $PORT
|