Created
October 6, 2017 11:03
-
-
Save lucax88x/d1ca940b3b9c0a285dcba6d3ae5519c6 to your computer and use it in GitHub Desktop.
docker-compose with proxy -> api / app -> postgres / redis / elasticsearch
This file contains hidden or 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: | |
proxy: | |
build: | |
context: ./src | |
dockerfile: dockerfile.proxy | |
links: | |
- api | |
- app | |
ports: | |
- "80:80" | |
api: | |
build: | |
context: ./src | |
dockerfile: dockerfile.api | |
environment: | |
ASPNETCORE_URLS: "http://+:80" | |
expose: | |
- "80" | |
links: | |
- "redis" | |
- "postgres" | |
- "elasticsearch1" | |
- "elasticsearch2" | |
app: | |
build: | |
context: ./src | |
dockerfile: dockerfile.app | |
environment: | |
ASPNETCORE_URLS: "http://+:80" | |
expose: | |
- "80" | |
elasticsearch1: | |
image: "docker.elastic.co/elasticsearch/elasticsearch:5.6.1" | |
volumes: | |
- esdata1:/usr/share/elasticsearch/data | |
expose: | |
- "9200" | |
- "9300" | |
environment: | |
cluster.name: docker-cluster | |
bootstrap.memory_lock: true | |
ES_JAVA_OPTS: -Xms512m -Xmx512m | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
mem_limit: 1g | |
elasticsearch2: | |
image: "docker.elastic.co/elasticsearch/elasticsearch:5.6.1" | |
volumes: | |
- esdata2:/usr/share/elasticsearch/data | |
expose: | |
- "9200" | |
- "9300" | |
environment: | |
cluster.name: docker-cluster | |
bootstrap.memory_lock: true | |
ES_JAVA_OPTS: -Xms512m -Xmx512m | |
discovery.zen.ping.unicast.hosts: elasticsearch1 | |
ulimits: | |
memlock: | |
soft: -1 | |
hard: -1 | |
mem_limit: 1g | |
redis: | |
image: "redis" | |
volumes: | |
- redisdata:/var/lib/redis | |
expose: | |
- "6379" | |
environment: | |
REDIS_PASSWORD: 'password' | |
postgres: | |
image: "postgres" | |
volumes: | |
- pgdata:/var/lib/postgresql/data | |
expose: | |
- "5432" | |
environment: | |
POSTGRES_USER: "admin" | |
POSTGRES_PASSWORD: "password" | |
POSTGRES_DB: "memore" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment