A progressive Node.js framework for building efficient and scalable server-side applications.
- Add
.env
file.
cp .env.example .env
- Create
docker-compose.yml
file.
version: '3.7'
services:
app:
image: ghcr.io/pnlinh-it/hello-nestjs:latest
container_name: hello_nestjs
ports:
- "80:3000"
env_file:
- .env
networks:
- hello_nestjs
depends_on:
- mysql
mysql:
image: mysql:8.0
container_name: mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
networks:
- hello_nestjs
networks:
hello_nestjs:
driver: bridge
name: hello_nestjs
- Start docker-compose
docker-compose up
- Change
Dockerfile.dev
CMD ["npm", "run", "start:debug_docker"]
- Start docker-compose
docker-compose -f docker-compose.dev.yml up --build
- Waiting util container is running then start VS code debug.
- In case error module not found, remove
dist
,node_modules
folder.