- Create a .env copy from .env.example (adjust e.g. ports)
cp .env.dev.example .env
- Startup containers via docker-compose:
docker-compose up -d
This docker setup is configured to use with an reverse proxy server in order to deploy & expose multiple docker setups from a single machine.
- Checkout/pull latest version of the project
- Create a .env copy from .env.example
cp .env.prod.example .env
- Edit variables in .env file (e.g. ports / secrets)
vi .env
- Startup containers via docker-compose:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
Tunnel to docker service shell:
docker-compose exec SERVICE_NAME_HERE /bin/sh
Additional CLI shortcuts a listed in the maidfile.md or via (Maid required):
maid help
Execute Maid tasks like:
maid TASKNAME
Installing npm dependencies via npm install
won't mount the localy installed modules into the docker context, since the
anonymous volumes aren’t removed until their parent container is removed.
To overcome this issue simply run:
docker-compose up --build -V
The --build
parameter will make sure the npm install is run (during the build process), and the -V
argument will remove any anonymous volumes and create them again.
On the left-hand side of VS Code, open the Debug & Run Panel and create a launch.json file. For proper NestJS backend debugging, replace the content of the config with the following:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Debug: app-name",
"remoteRoot": "/usr/src/app",
"localRoot": "${workspaceFolder}/backend",
"protocol": "inspector",
"port": 9229,
"restart": true,
"address": "0.0.0.0",
"skipFiles": ["<node_internals>/**"]
}
]
}