Skip to content

Instantly share code, notes, and snippets.

@elishaukpong
Created August 6, 2020 08:28
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 elishaukpong/dcc00f66a43cec6219e26e3438ed57b3 to your computer and use it in GitHub Desktop.
Save elishaukpong/dcc00f66a43cec6219e26e3438ed57b3 to your computer and use it in GitHub Desktop.
version: '2'
services:
##
# Autodiscovery : Consul
##
autodiscovery:
build: ./autodiscovery/
mem_limit: 128m
expose:
- 53
- 8300
- 8301
- 8302
- 8400
- 8500
ports:
- 8500:8500
dns:
- 127.0.0.1
##
# Battle Microservice
##
microservice_battle_fpm:
build: ./microservices/battle/php-fpm/
volumes_from:
- source_battle
links:
- autodiscovery
- microservice_user_nginx
expose:
- 9000
environment:
- BACKEND=microservice-battle-nginx
- CONSUL=autodiscovery
microservice_battle_nginx:
build: ./microservices/battle/nginx/
volumes_from:
- source_battle
links:
- autodiscovery
- microservice_battle_fpm
environment:
- BACKEND=microservice-battle-fpm
- CONSUL=autodiscovery
ports:
- 8081:80
- 9091:9090
##
# Location Microservice
##
microservice_location_fpm:
build: ./microservices/location/php-fpm/
volumes_from:
- source_location
links:
- autodiscovery
expose:
- 9000
environment:
- BACKEND=microservice-location-nginx
- CONSUL=autodiscovery
microservice_location_nginx:
build: ./microservices/location/nginx/
volumes_from:
- source_location
links:
- autodiscovery
- microservice_location_fpm
environment:
- BACKEND=microservice-location-fpm
- CONSUL=autodiscovery
ports:
- 8082:80
- 9092:9090
##
# Secret Microservice
##
microservice_secret_fpm:
build: ./microservices/secret/php-fpm/
volumes_from:
- source_secret
links:
- autodiscovery
- microservice_secret_database
expose:
- 9000
environment:
- BACKEND=microservice-secret-nginx
- CONSUL=autodiscovery
microservice_secret_nginx:
build: ./microservices/secret/nginx/
volumes_from:
- source_secret
links:
- autodiscovery
- microservice_secret_fpm
environment:
- BACKEND=microservice-secret-fpm
- CONSUL=autodiscovery
ports:
- 8083:80
- 9093:9090
microservice_secret_database:
build: ./microservices/secret/database/
environment:
- CONSUL=autodiscovery
- MYSQL_ROOT_PASSWORD=mysecret
- MYSQL_DATABASE=finding_secrets
- MYSQL_USER=secret
- MYSQL_PASSWORD=mysecret
ports:
- 6666:3306
##
# User Microservice
##
microservice_user_fpm:
build: ./microservices/user/php-fpm/
volumes_from:
- source_user
links:
- autodiscovery
expose:
- 9000
environment:
- BACKEND=microservice-user-nginx
- CONSUL=autodiscovery
microservice_user_nginx:
build: ./microservices/user/nginx/
volumes_from:
- source_user
links:
- autodiscovery
- microservice_user_fpm
environment:
- BACKEND=microservice-user-fpm
- CONSUL=autodiscovery
ports:
- 8084:80
- 9094:9090
##
# Source containers
##
source_battle:
image: nginx:stable
volumes:
- ../source/battle:/var/www/html
command: "true"
source_location:
image: nginx:stable
volumes:
- ../source/location:/var/www/html
command: "true"
source_secret:
image: nginx:stable
volumes:
- ../source/secret:/var/www/html
command: "true"
source_user:
image: nginx:stable
volumes:
- ../source/user:/var/www/html
command: "true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment