smk-chat/Dockerfile

22 lines
342 B
Docker
Raw Normal View History

2024-06-11 17:22:27 +03:00
FROM node:latest
2024-06-21 16:26:34 +03:00
ARG UID=987
ARG GID=987
RUN groupadd -g ${GID} chat && useradd -d /usr/src/app -g ${GID} -u ${UID} chat
2024-06-11 17:22:27 +03:00
2024-06-21 16:26:34 +03:00
RUN mkdir -p /usr/src/app
RUN chmod 750 -R /usr/src/app
2024-06-11 17:22:27 +03:00
COPY package*.json ./
2024-06-21 16:26:34 +03:00
WORKDIR /usr/src/app
RUN chown -R chat:chat /usr/src/app
2024-06-11 17:22:27 +03:00
RUN npm install
COPY . .
EXPOSE 8080
2024-06-21 16:26:34 +03:00
USER chat
2024-06-11 17:22:27 +03:00
CMD [ "node", "src/index.js" ]