Last active
September 19, 2020 13:40
-
-
Save sidpalas/850a08326f46839057f611c05fa14f59 to your computer and use it in GitHub Desktop.
Docker compose with build configuration option
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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