node-pt / Dockerfile
bardd's picture
Update Dockerfile
19a7ce5 verified
raw
history blame
603 Bytes
FROM node:20-alpine
# Create app directory
WORKDIR /app
# Install app dependencies
COPY package*.json ./
# Install dependencies
RUN npm install
# Install additional dependencies
RUN npm install mongoose bcrypt jsonwebtoken @nestjs/passport @nestjs/jwt passport-jwt passport-custom jwt-decode passport-local uuid i18n-ts
# Bundle app source
COPY . .
# Create the dist directory and set permissions
RUN mkdir -p /app/dist && chown -R node:node /app
# Switch to non-root user
USER node
# Expose the port the app runs on
EXPOSE 7860
# Command to run the application
CMD ["npm", "run", "start:dev"]