awesome-compose/react-express-mongodb/docker-compose.yml
Guillaume Lours e29f0d1c54
[react-express-mongdb] use compose network to communicate between services (#62)
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-05-12 11:18:38 +02:00

48 lines
846 B
YAML

version: "3.7"
services:
frontend:
build:
context: frontend
args:
FRONT_END_PORT: 5000
ports:
- 5000:5000
stdin_open: true
volumes:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
container_name: frontend
restart: always
networks:
- react-express
depends_on:
- server
server:
container_name: server
restart: always
build:
context: server
args:
NODE_PORT: 3000
volumes:
- ./server:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- mongo
networks:
- express-mongo
- react-express
mongo:
container_name: mongo
restart: always
image: mongo:4.2.0
volumes:
- ./data:/data/db
networks:
- express-mongo
networks:
react-express:
express-mongo: