Deployment

You can deploy the service either as a container or run it locally in production or development mode.

The E-Invoice-EU service can be used in one of several ways:

  • Run as a (docker) container.
  • Build and run it in production mode.
  • Run it locally in development mode.

Docker Container

By far, the easiest way to run the E-Invoice-EU service is to run the containerized version.

docker pull gflohr/e-invoice-eu:latest
docker run --rm -p 3000:3000 --name e-invoice-eu gflohr/e-invoice-eu:latest
nerdctl pull gflohr/e-invoice-eu:latest
nerdctl run --rm -p 3000:3000 --name e-invoice-eu gflohr/e-invoice-eu:latest

Download

All other possibilities require a local copy of the sources.

You can download the latest stable version from the download page and then unzip the ZIP archive or untar the tarball.

If you have git, you can also clone the repository:

# HTTPS
git clone https://github.com/gflohr/e-invoice-eu.git

# SSH
git clone git@github.com:gflohr/e-invoice-eu.git

The version you will get by cloning the repository is potentially a little bit more up-to-date.

Deploy in Production Mode

You can also build the server and then run it anywhere you like. After cloning the repository and changing into its root directory, execute the following commands:

npm install
npm run build
yarn install
yarn run build
pnpm install
pnpm run build
bun install
bun run build

Run with Node.js

You can then run the application with Node.js like this:

NODE_ENV=production npm run start:prod
NODE_ENV=production yarn run start:prod
NODE_ENV=production pnpm run start:prod
NODE_ENV=production pnpm run start:prod

See the NestJS documentation for deployment for more information.

Run with Bun or Deno

You can also run the application with bun or deno. But you then have to specify the complete path to the main JavaScript file:

NODE_ENV=production bun apps/server/dist/main.js
NODE_ENV=production deno --allow-env --allow-read --allow-net apps/server/dist/main.js
NODE_ENV=production node apps/server/dist/main.js

Run in Development Mode

You can also run the application without building it first.

cd apps/server
npm install
npm run start:dev
cd apps/server
yarn install
yarn run start:dev
cd apps/server
pnpm install
pnpm run start:dev
cd apps/server
bun install
bun run start:dev

This will automatically re-compile the source code and re-start the server, whenever you make changes to the code.

Environment Variables

The service is configured with environment variables.

You can either pass these environment variables on the commandline or place a file called .env in the directory, where you start the service. This file has lines of the form VARIABLE=VALUE, see the dotenv docs for more information.

If you are running the docker container, you must either bind mount an .env file into the container or pass the environment variable on the commandline with option -e:

docker run --rm -p 3300:3300 --name e-invoice-eu -e PORT=3300 gflohr/e-invoice-eu:latest
nerdctl run --rm -p 3300:3300 --name e-invoice-eu -e PORT=3300 gflohr/e-invoice-eu:latest

This would start the service on port 3300 instead of port 3000 (although it would be easier to simply map port 3300 to the host port 3000).

The following environment variables are supported:

NODE_ENV

To quote the NestJS documentation:

While there's technically no difference between development and production in Node.js and NestJS, it's a good practice to set the NODE_ENV environment variable to production when running your application in a production environment, as some libraries in the ecosystem may behave differently based on this variable (e.g., enabling or disabling debugging output, etc.).

In brief: Set the environment variable to "production", when running the service in production mode.

PORT

Set this to a valid port number if you are not happy with the default port of 3000.

Note: This has currently no effect, when running the service in a container, see https://github.com/gflohr/e-invoice-eu/issues/76.

LIBRE_OFFICE

Path to LibreOffice. E-Invoice-EU uses LibreOffice in headless mode to generate PDFs from spreadsheet files. It depends on your usage whether you need that or not.

On macOS, LibreOffice is usually installed as:

/Applications/LibreOffice.app/Contents/MacOS/soffice

On Windows, the path is:

C:\Program Files\LibreOffice\program\soffice.exe

If the location of the LibreOffice executable is not configured, it is searched in $PATH.

LIBREOFFICE

An alias for the environment variable LIBRE_OFFICE.

This website uses cookies and similar technologies to provide certain features, enhance the user experience and deliver content that is relevant to your interests. Depending on their purpose, analysis and marketing cookies may be used in addition to technically necessary cookies. By clicking on "Agree and continue", you declare your consent to the use of the aforementioned cookies. Here you can make detailed settings or revoke your consent (in part if necessary) with effect for the future. For further information, please refer to our Privacy Policy.