jurmy24 commited on
Commit
6dbf2bd
·
1 Parent(s): 488d2e9

fix: update dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -17
  2. README.md +1 -1
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM oven/bun:1 as build
2
 
3
  # Set working directory
4
  WORKDIR /app
@@ -7,10 +7,10 @@ WORKDIR /app
7
  COPY viewer/ .
8
 
9
  # Install dependencies without frozen lockfile to allow migration from package-lock.json
10
- RUN bun install
11
 
12
  # Build the application with more verbose output
13
- RUN bun run build || (echo "Build failed. Check the error messages above." && exit 1)
14
 
15
  # Production stage
16
  FROM nginx:alpine
@@ -18,20 +18,8 @@ FROM nginx:alpine
18
  # Copy built assets from build stage
19
  COPY --from=build /app/dist /usr/share/nginx/html
20
 
21
- # Configure nginx to use port 7860 and support SPA routing
22
- RUN echo 'server { \
23
- listen 7860; \
24
- root /usr/share/nginx/html; \
25
- index index.html; \
26
- location / { \
27
- try_files $uri $uri/ /index.html; \
28
- } \
29
- }' > /etc/nginx/conf.d/default.conf
30
-
31
  # Expose port
32
- EXPOSE 7860
33
 
34
  # Start nginx
35
- CMD ["nginx", "-g", "daemon off;"]
36
-
37
-
 
1
+ FROM node:18-alpine AS build
2
 
3
  # Set working directory
4
  WORKDIR /app
 
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
16
  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;"]
 
 
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: ⚡
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
  ---
 
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
  ---