jurmy24 commited on
Commit
5db1611
·
1 Parent(s): 6dbf2bd

fix: add nginx conf

Browse files
Files changed (3) hide show
  1. Dockerfile +6 -3
  2. README.md +1 -1
  3. 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 without frozen lockfile to allow migration from package-lock.json
10
  RUN npm install
11
 
12
- # Build the application with more verbose output
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 80
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: 80
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
+ }