Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
depress-backend/Dockerfile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
39 lines (20 sloc)
631 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:16-slim | |
ENV USER=node | |
RUN apt-get update && apt-get install -y vim | |
RUN mkdir -p /home/node/app | |
WORKDIR /home/node/app | |
COPY . . | |
COPY package*.json ./ | |
COPY tsconfig.json ./ | |
RUN chown -R node:node /home/node/app | |
RUN mkdir /home/node/.npm-global | |
RUN chown -R 1000:1000 /home/node/.npm-global | |
ENV PATH=/home/node/.npm-global/bin:$PATH | |
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global | |
RUN npm --global config set user "${USER}" | |
USER node | |
RUN npm install --loglevel=warn; | |
RUN npm i --location=global pm2 | |
RUN npm run build | |
EXPOSE 6000 | |
CMD [ "pm2-runtime", "--no-autorestart", "npm", "--", "run", "start-prod" ] |