sheet2023/Note_singe
0
1FROM node:182 3 4ARG DEBIAN_FRONTEND=noninteractive5 6ENV BING_HEADER ""7 8# Set home to the user's home directory9ENV HOME=/home/user \10 PATH=/home/user/.local/bin:$PATH11 12# Set up a new user named "user" with user ID 100013RUN useradd -o -u 1000 user && mkdir -p $HOME/app && chown -R user $HOME14 15# Switch to the "user" user16USER user17 18# Set the working directory to the user's home directory19WORKDIR $HOME/app20 21# Install app dependencies22# A wildcard is used to ensure both package.json AND package-lock.json are copied23# where available (npm@5+)24COPY --chown=user package*.json $HOME/app/25 26RUN npm install27 28# Copy the current directory contents into the container at $HOME/app setting the owner to the user29COPY --chown=user . $HOME/app/30 31RUN npm run build32 33ENV PORT 786034EXPOSE 786035 36CMD npm start37 