Spaces:
Configuration error
Configuration error
File size: 946 Bytes
6ae30ed a336e20 6ae30ed 28769dc 6ae30ed 28769dc 924eaa0 6ae30ed 924eaa0 adb8fd9 6ae30ed 924eaa0 6ae30ed 28769dc 6ae30ed adb8fd9 a336e20 28769dc 924eaa0 adb8fd9 6ae30ed | 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 | FROM node:20-slim
# Install required system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# The node image likely already has a user with UID 1000
# We'll just use that user instead of creating a new one
# Find out the username with UID 1000
RUN USER_1000=$(getent passwd 1000 | cut -d: -f1) || echo "No user with UID 1000"
# Switch to the user with UID 1000
USER node
# Set the working directory
WORKDIR $HOME/app
# Copy package.json and package-lock.json first for better caching
COPY --chown=node package*.json ./
# Install dependencies
RUN npm install
# Copy the current directory contents into the container
COPY --chown=node . $HOME/app
# Make port 7860 available outside the container
EXPOSE 7860
# Create a directory for temporary data (if needed)
RUN mkdir -p /tmp/data
RUN chmod 777 /tmp/data
# Run the server
CMD ["node", "server.js"] |