Skip to content

Instantly share code, notes, and snippets.

@sidpalas
Last active September 19, 2020 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidpalas/850a08326f46839057f611c05fa14f59 to your computer and use it in GitHub Desktop.
Save sidpalas/850a08326f46839057f611c05fa14f59 to your computer and use it in GitHub Desktop.
Docker compose with build configuration option
version: "3"
services:
react-app:
# react-app code and Dockerfile within the client sub directory
build: ./client
stdin_open: true
ports:
- "3000:3000"
networks:
- mern-app
api-server:
# express api-server code and Dockerfile within the server sub directory
build: ./server
ports:
- "5000:5000"
networks:
- mern-app
depends_on:
- mongo
mongo:
image: mongo:3.6.19-xenial
ports:
- "27017:27017"
networks:
- mern-app
volumes:
- mongo-data:/data/db
networks:
mern-app:
driver: bridge
volumes:
mongo-data:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment