Adding docker support

This commit is contained in:
Adolfo Reyna
2024-10-18 11:59:15 -04:00
parent e52c379a55
commit aac7080f7f
5 changed files with 55 additions and 3 deletions

38
docker-compose.yml Normal file
View File

@@ -0,0 +1,38 @@
version: '3.8'
networks:
emi-network:
driver: bridge
services:
app:
build:
context: .
ports:
- '3001:3001'
environment:
- MONGO_URL=mongodb://mongo:27017/testdb
- PORT=3001
volumes:
- .:/app
- '/app/node_modules'
depends_on:
- mongo
command: nodemon
networks:
- emi-network
mongo:
image: mongo:latest
ports:
- '27017:27017'
networks:
- emi-network
volumes:
- mongodbdata:/data/db
- ./dump:/dump
#entrypoint: mongodump ${MONGO_URL} && mongorestore --db EMI_SOCIAL dump/EMI_SOCIAL/ && mongod
volumes:
mongodbdata:
driver: local # This ensures the volume is created