Spaces:
Running
Running
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"] |