Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +1 -10
Dockerfile
CHANGED
|
@@ -35,17 +35,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 35 |
COPY --chown=pn frontend frontend
|
| 36 |
WORKDIR $HOME/app/frontend
|
| 37 |
RUN npm install
|
| 38 |
-
RUN npm run build
|
| 39 |
|
| 40 |
-
# Debugging: Check if dist directory exists after build
|
| 41 |
-
RUN ls -la
|
| 42 |
-
RUN if [ ! -d "dist" ]; then echo "Build did not create dist directory, exiting..."; exit 1; fi
|
| 43 |
-
|
| 44 |
-
# Switch to the directory where nginx expects static files
|
| 45 |
-
WORKDIR /usr/share/nginx/html
|
| 46 |
-
|
| 47 |
-
# Copy the build output to the nginx serving directory
|
| 48 |
-
COPY --chown=pn $HOME/app/frontend/dist .
|
| 49 |
|
| 50 |
# Switch back to the app directory and setup the backend
|
| 51 |
USER pn
|
|
|
|
| 35 |
COPY --chown=pn frontend frontend
|
| 36 |
WORKDIR $HOME/app/frontend
|
| 37 |
RUN npm install
|
| 38 |
+
RUN npm run build && cp -r dist/. /usr/share/nginx/html
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
# Switch back to the app directory and setup the backend
|
| 42 |
USER pn
|