A containerised eShopNestjsMicroserviceBoilerplate (mmm Java-style naming)
Component | Link |
---|---|
Language | Node.js |
Framework | NestJS |
Containerisation | Docker |
- Adapters
- Configs
- Database
- Domain
- DTO
- Exceptions
- Repositories
- Types
- Modules
- Decorators
- Filters
- Guards
- Interceptors
- Modules
- Pipes
- Utils
Install the dependencies:
yarn install
Define environment variables for your development environment:
These are passed to the Docker container via
docker-compose.yaml
in development. When running in production, the environment variables must be passed to the container when it is run.
cp .env.example .env
Run locally:
This builds the Docker image and runs it automatically with the config defined in
docker-compose.yaml
. This saves you having to build the docker image and then run a manualdocker run
command with all the flags (for environment variables, ports, etc).
Local
yarn start:dev
Using Docker
docker compose up --build --remove-orphans app-dev
Note: Environment variables are never baked into the image, or they wouldn't be environment variables. The production environment will start a Docker container based on this image, but it will have to pass the environment variables to the container when it runs it.
Example manually running a container with environment variables and ports defined: Using Docker
docker compose up --build --remove-orphans app