Spaces:
Running
Running
fix: add nginx conf
Browse files- Dockerfile +6 -3
- README.md +1 -1
- viewer/nginx.conf +10 -0
Dockerfile
CHANGED
@@ -6,10 +6,10 @@ WORKDIR /app
|
|
6 |
# Copy the viewer directory with all its contents
|
7 |
COPY viewer/ .
|
8 |
|
9 |
-
# Install dependencies
|
10 |
RUN npm install
|
11 |
|
12 |
-
# Build the application
|
13 |
RUN npm run build || (echo "Build failed. Check the error messages above." && exit 1)
|
14 |
|
15 |
# Production stage
|
@@ -18,8 +18,11 @@ FROM nginx:alpine
|
|
18 |
# Copy built assets from build stage
|
19 |
COPY --from=build /app/dist /usr/share/nginx/html
|
20 |
|
|
|
|
|
|
|
21 |
# Expose port
|
22 |
-
EXPOSE
|
23 |
|
24 |
# Start nginx
|
25 |
CMD ["nginx", "-g", "daemon off;"]
|
|
|
6 |
# Copy the viewer directory with all its contents
|
7 |
COPY viewer/ .
|
8 |
|
9 |
+
# Install dependencies
|
10 |
RUN npm install
|
11 |
|
12 |
+
# Build the application
|
13 |
RUN npm run build || (echo "Build failed. Check the error messages above." && exit 1)
|
14 |
|
15 |
# Production stage
|
|
|
18 |
# Copy built assets from build stage
|
19 |
COPY --from=build /app/dist /usr/share/nginx/html
|
20 |
|
21 |
+
# Copy nginx configuration
|
22 |
+
COPY viewer/nginx.conf /etc/nginx/conf.d/default.conf
|
23 |
+
|
24 |
# Expose port
|
25 |
+
EXPOSE 7860
|
26 |
|
27 |
# Start nginx
|
28 |
CMD ["nginx", "-g", "daemon off;"]
|
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: ⚡
|
|
4 |
colorFrom: red
|
5 |
colorTo: indigo
|
6 |
sdk: docker
|
7 |
-
app_port:
|
8 |
pinned: false
|
9 |
short_description: Upload a URDF folder to view and interact with your robot.
|
10 |
---
|
|
|
4 |
colorFrom: red
|
5 |
colorTo: indigo
|
6 |
sdk: docker
|
7 |
+
app_port: 7860
|
8 |
pinned: false
|
9 |
short_description: Upload a URDF folder to view and interact with your robot.
|
10 |
---
|
viewer/nginx.conf
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
server {
|
2 |
+
listen 7860;
|
3 |
+
server_name localhost;
|
4 |
+
|
5 |
+
location / {
|
6 |
+
root /usr/share/nginx/html;
|
7 |
+
index index.html index.htm;
|
8 |
+
try_files $uri $uri/ /index.html;
|
9 |
+
}
|
10 |
+
}
|