diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..870d3590e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +# Compiled output +dist +node_modules + + +# Test directory +test + +# Files that not needed for the application itself +.eslintrc.js +.gitignore + +README.md + +# IDEs +.vscode + +# Git files +.git \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8ec6a904d..2130ec892 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ lerna-debug.log* *.launch .settings/ *.sublime-workspace +package-lock.json # IDE - VSCode .vscode/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d5a783fcf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:12.16.3-alpine +WORKDIR app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build +USER node +EXPOSE 4000 +ENTRYPOINT ["node", "dist/main.js"] \ No newline at end of file diff --git a/package.json b/package.json index d57dd9c9f..09958f383 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@nestjs/jwt": "^7.2.0", "@nestjs/passport": "^7.1.0", "@nestjs/platform-express": "^7.5.1", + "dockerfile_lint": "^0.3.4", "helmet": "^4.2.0", "passport": "^0.4.1", "passport-http": "^0.3.0",