Spaces:
Sleeping
Sleeping
make this code runable and solve error
Browse files- Dockerfile +12 -0
- frontend +1 -0
Dockerfile
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Use an official Python runtime as a base image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
|
@@ -7,6 +14,9 @@ WORKDIR /app
|
|
| 7 |
# Copy the current directory contents into the container
|
| 8 |
COPY . /app
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
# Install any needed packages specified in requirements.txt
|
| 11 |
# COPY requirements.txt /app/
|
| 12 |
# RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -16,6 +26,8 @@ RUN pip install python-dotenv
|
|
| 16 |
RUN pip install openai
|
| 17 |
RUN pip install chainlit
|
| 18 |
RUN chmod -R 777 /app
|
|
|
|
|
|
|
| 19 |
# Make port 8000 available to the world outside this container
|
| 20 |
EXPOSE 8080
|
| 21 |
|
|
|
|
| 1 |
+
FROM node:18 AS frontend-build
|
| 2 |
+
WORKDIR /app/frontend
|
| 3 |
+
COPY ./frontend/package*.json ./
|
| 4 |
+
RUN npm install
|
| 5 |
+
COPY ./frontend .
|
| 6 |
+
RUN npm run build
|
| 7 |
+
|
| 8 |
# Use an official Python runtime as a base image
|
| 9 |
FROM python:3.9-slim
|
| 10 |
|
|
|
|
| 14 |
# Copy the current directory contents into the container
|
| 15 |
COPY . /app
|
| 16 |
|
| 17 |
+
|
| 18 |
+
# Copy the built frontend files to a directory named 'static' for FastAPI to serve
|
| 19 |
+
COPY --from=frontend-build /app/frontend/dist /app/static
|
| 20 |
# Install any needed packages specified in requirements.txt
|
| 21 |
# COPY requirements.txt /app/
|
| 22 |
# RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 26 |
RUN pip install openai
|
| 27 |
RUN pip install chainlit
|
| 28 |
RUN chmod -R 777 /app
|
| 29 |
+
|
| 30 |
+
|
| 31 |
# Make port 8000 available to the world outside this container
|
| 32 |
EXPOSE 8080
|
| 33 |
|
frontend
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Subproject commit 2638a4a37f417bb4fea4f3af1167abf02b8a7f93
|