Skip to content

Instantly share code, notes, and snippets.

@2u4u
Created March 30, 2020 18:20
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 2u4u/2b13910c220f5a647f15d198a50ebe2a to your computer and use it in GitHub Desktop.
Save 2u4u/2b13910c220f5a647f15d198a50ebe2a to your computer and use it in GitHub Desktop.
version: '3.7'
services:
server:
build:
context: .
dockerfile: Dockerfile
image: myapp-server-img
container_name: myapp-node-express
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
ports:
- "8080:8080"
depends_on:
- mongo
env_file: .env
environment:
- MONGO_HOSTNAME=$MONGO_HOSTNAME
- MONGO_PORT=$MONGO_PORT
- MONGO_DB=$MONGO_DB
mongo:
image: mongo
container_name: myapp-mongodb
ports:
- "27017:27017"
client:
build:
context: ./client/
dockerfile: Dockerfile
image: client
container_name: myapp-react-client
command: npm start
volumes:
- ./client/:/usr/app
- /usr/app/node_modules
depends_on:
- server
ports:
- "3000:3000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment