Skip to content

Instantly share code, notes, and snippets.

@Rolilink
Last active April 26, 2020 21:57
Show Gist options
  • Save Rolilink/23e376b3c4b8a47ad488bba2607b4c6f to your computer and use it in GitHub Desktop.
Save Rolilink/23e376b3c4b8a47ad488bba2607b4c6f to your computer and use it in GitHub Desktop.
Initial Architecture
version: '3'
services:
cats-mongo:
image: mongo:latest
environment:
MONGO_INITDB_ROOT_USERNAME: mongo
MONGO_INITDB_ROOT_PASSWORD: mongo
MONGO_INITDB_DATABASE: cats
volumes:
- cats_mongodb_data:/data/db
command: mongod --auth
dogs-mongo:
image: mongo:latest
environment:
MONGO_INITDB_ROOT_USERNAME: mongo
MONGO_INITDB_ROOT_PASSWORD: mongo
MONGO_INITDB_DATABASE: dogs
volumes:
- dogs_mongodb_data:/data/db
command: mongod --auth
dogs-api:
build:
context: ./dogs-api
dockerfile: .docker/Dockerfile
volumes:
- ./dogs-api/index.js:/www/index.js # mounts a volume to enable nodemon reload when changing files
- ./dogs-api/lib:/www/lib # mounts a volume to enable nodemon reload when changing files
depends_on:
- dogs-mongo
cats-api:
build:
context: ./cats-api
dockerfile: .docker/Dockerfile
volumes:
- ./cats-api/index.js:/www/index.js # mounts a volume to enable nodemon reload when changing files
- ./cats-api/lib:/www/lib # mounts a volume to enable nodemon reload when changing files
depends_on:
- cats-mongo
cats-dogs-react:
stdin_open: true # we want to run the react app on stdin mode because an issue with create-react-app scripts
build:
context: ./cats-dogs-react
dockerfile: .docker/Dockerfile
volumes:
- ./cats-dogs-react/src:/www/src # mounts a volume to enable hot reload when changing files
- ./cats-dogs-react/public:/www/public # mounts a volume to hot reload when changing files
volumes:
cats_mongodb_data:
dogs_mongodb_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment