Skip to content

Commit

Permalink
Merge pull request #5 from WanderDinizVeloso/feature/docker-compose
Browse files Browse the repository at this point in the history
feat: add and configure docker-compose mongodb-redis-localstack
  • Loading branch information
WanderDinizVeloso authored Dec 8, 2023
2 parents c34d646 + cc6680b commit 68b0aed
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/dist
/node_modules

#docker
/volume

# Env
.env

Expand Down
42 changes: 42 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: "3.8"

services:
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME-localstack-main}"
image: localstack/localstack
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
environment:
- DEBUG=${DEBUG-}
- DOCKER_HOST=unix:///var/run/docker.sock
volumes:
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"

mongodb:
image: mongo:6-jammy
ports:
- '27017:27017'
volumes:
- mongodb:/data/db

redis:
image: redis:6.2-alpine
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning
volumes:
- redis:/data


volumes:
mongodb:
driver: local
redis:
driver: local


networks:
node-network:
driver: bridge
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:dev": "docker-compose up | nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
Expand Down

0 comments on commit 68b0aed

Please sign in to comment.