File size: 1,098 Bytes
c83b086
e34472c
c83b086
 
e34472c
c83b086
 
e34472c
c83b086
 
 
e34472c
c83b086
 
e34472c
c83b086
 
e34472c
c83b086
 
 
ceb1014
c83b086
e34472c
6bc7874
 
 
 
 
 
 
 
 
a88f07c
ceb1014
 
 
c83b086
 
5db1611
e34472c
5db1611
e34472c
c83b086
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM node:18-alpine

# Set up a new user named "user" with user ID 1000
RUN adduser -D user || adduser -D -u 1001 user

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory
WORKDIR $HOME/app

# Copy package files
COPY --chown=user viewer/package*.json ./

# Install dependencies
RUN npm install

# Copy the entire viewer directory
COPY --chown=user viewer/ .

# # Debug: List all files in the src/components directory
# RUN echo "=== Listing src/components directory ===" && \
#     ls -la src/components && \
#     echo "=== Listing UrdfViewer file specifically ===" && \
#     ls -la src/components/UrdfViewer* && \
#     echo "=== Current working directory ===" && \
#     pwd && \
#     echo "=== Directory structure ===" && \
#     find . -type f -name "*.tsx" | sort

# Ensure proper file permissions
RUN chmod -R 755 .

# Build the application
RUN npm run build

# Expose port
EXPOSE 7860

# Start the application
CMD ["npm", "run", "preview", "--", "--port", "7860", "--host"]