Sign inSign up

nitin27may/mean-expressjs

By nitin27may

Updated about 1 month ago

This image is one of three images from repo https://github.com/nitin27may/mean-docker

Image
0

1.3K

nitin27may/mean-expressjs repository overview

Api (Expressjs)

This project contains the api using expressjs

Development server

Run npm run dev-server to start the api server in development mode (using nodemon).

Dockerfile Production
FROM node:12.8-alpine

# Copy dependency definitions
COPY package.json package-lock.json ./

# disabling ssl for npm for Dev or if you are behind proxy
RUN npm set strict-ssl false

## installing and Storing node modules on a separate layer will 
## prevent unnecessary npm installs at each build
RUN npm i && mkdir /app && mv ./node_modules ./app

# Change directory so that our commands run inside this new directory
WORKDIR /app

# Get all the code needed to run the app
COPY . /app/

# Expose the port the app runs in
EXPOSE 3000

# Serve the app
CMD ["npm", "start"]

Dockerfile Development
# Create image based off of the official 12.8-alpine
FROM node:14

# disabling ssl for npm for Dev or if you are behind proxy
RUN npm set strict-ssl false

# Change directory so that our commands run inside this new directory
WORKDIR /api

# Copy dependency definitions
COPY package.json ./

## installing node modules
RUN npm i


COPY . .

# Expose the port the app runs in
EXPOSE 3000

# Serve the app
CMD [ "npm", "run", "dev-server" ]

Tag summary

Content type

Image

Digest

sha256:919c01401

Size

74.3 MB

Last updated

about 1 month ago

docker pull nitin27may/mean-expressjs