Skip to content

Instantly share code, notes, and snippets.

@tushartuteja
Created July 2, 2020 17:42
Show Gist options
  • Save tushartuteja/ff62fb09786f21e71588e8723dd1e94e to your computer and use it in GitHub Desktop.
Save tushartuteja/ff62fb09786f21e71588e8723dd1e94e to your computer and use it in GitHub Desktop.
version: "3"
services:
service_a:
build:
dockerfile: service_a/Dockerfile
context: .
volumes:
- ./service_a:/myapp
ports:
- "8080:3000"
depends_on:
- service_a_db
- service_a_redis
- service_b
- service_c
service_a_db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: service_a
MYSQL_DATABASE: "db"
MYSQL_USER: "user"
MYSQL_PASSWORD: "pass"
volumes:
- ./service_a/tmp/mysqldb:/var/lib/mysql
ports:
- "3306:3306"
service_a_redis:
image: redis
ports:
- "6379:6379"
volumes:
- ./service_a/tmp/redisdb:/data
service_b:
build:
dockerfile: service_b/Dockerfile
context: .
volumes:
- ./service_b:/myapp
ports:
- "8081:3000"
depends_on:
- service_b_mongodb
service_b_mongodb:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
ports:
- "27017:27017"
service_c:
build:
dockerfile: service_c/Dockerfile
context: .
volumes:
- ./service_c:/myapp
ports:
- "8082:3000"
depends_on:
- service_c_db
service_c_db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: service_c
volumes:
- ./service_c/tmp/mysqldb:/var/lib/mysql
ports:
- "3308:3306"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment