add dockerfile

This commit is contained in:
AlecM33
2022-07-04 15:58:45 -04:00
parent f57cbc44bd
commit c34a4e9141
2 changed files with 22 additions and 2 deletions

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
# Use the official lightweight Node.js 12 image.
# https://hub.docker.com/_/node
FROM node:14-slim
# Create and change to the app directory.
WORKDIR /usr/src/app
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./
# Install production dependencies.
RUN npm install --only=production
# Copy local code to the container image.
COPY . ./
# Run the web service on container startup.
CMD [ "npm", "start" ]

View File

@@ -12,8 +12,8 @@
"start:dev:no-hot-reload": "NODE_ENV=development && node index.js",
"start:dev:windows": "SET NODE_ENV=development && nodemon index.js",
"start:dev:windows:no-hot-reload": "SET NODE_ENV=development && node index.js",
"start": "NODE_ENV=production node index.js -- loglevel=info",
"start:windows": "SET NODE_ENV=production && node index.js -- loglevel=warn port=8080",
"start": "NODE_ENV=production node index.js -- loglevel=debug",
"start:windows": "SET NODE_ENV=production && node index.js -- loglevel=debug port=8080",
"test": "jasmine && karma start --single-run --browsers ChromeHeadless karma.conf.js",
"test:unit": "jasmine",
"test:e2e": "karma start --single-run --browsers ChromeHeadless karma.conf.js"