canvas2code / Dockerfile
Supercellat124578's picture
Fix user permission error in Dockerfile
5dcb8ae
raw
history blame contribute delete
537 Bytes
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM node:18-alpine
# The node image already has a user named 'node' with UID 1000. We just need to switch to it.
USER node
ENV PATH="/home/node/.local/bin:$PATH"
WORKDIR /app
# Copy package files first for better caching
COPY --chown=node package*.json ./
RUN npm install
# Copy all files
COPY --chown=node . .
# Hugging Face Spaces expose port 7860
ENV PORT=7860
EXPOSE 7860
CMD ["npm", "start"]