A common and reliable pattern in service unit files is thus:
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
| const Printer = require('pdfmake') | |
| const axios = require('axios') | |
| const path = require('path') | |
| module.exports.pdf = async (req, res, next) => { | |
| var printer = new Printer({ | |
| Roboto: { | |
| normal: path.resolve('src', 'fonts', 'Roboto.ttf'), | |
| bold: path.resolve('src', 'fonts', 'Roboto-Bold.ttf'), | |
| } |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
| # Use leightweight linux distrubution | |
| # Choose alpine because it's size only 5MB | |
| FROM alpine:3.7 | |
| ENV NVM_DIR /usr/local/nvm | |
| ENV NODE_ENV=local | |
| ENV PORT=4044 | |
| ENV JWT_ACCESS_TOKEN=iamdeveloper | |
| ENV JWT_REFRESH_TOKEN=iamdevelopertoo | |
| ENV JWT_EXPIRATION=60m |
These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.
Create an account at Linode
Click on Create Linode
Choose your server options (OS, region, etc)
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user