urdf-visualizer / Dockerfile
jurmy24's picture
fix: modify dockerfile to use what other space had
5a9fad9
raw
history blame
700 Bytes
FROM node:18-alpine
# Create user with UID 1001 (since 1000 is taken by node user)
RUN adduser -D -u 1001 user
# Set up environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Create and set up app directory with proper permissions
WORKDIR $HOME/app
RUN mkdir -p $HOME/app && \
chown -R user:user $HOME/app
# Switch to the user
USER user
# Copy package files
COPY --chown=user viewer/package*.json ./
# Install dependencies
RUN npm install
# Copy the entire viewer directory
COPY --chown=user viewer/ .
# Build the application
RUN npm run build
# Expose port
EXPOSE 7860
# Start the application
CMD ["npm", "run", "preview", "--", "--port", "7860", "--host"]