Last active
April 14, 2019 08:26
-
-
Save sweetyclem/817573f6d324e51cd26fff68ac1a5c83 to your computer and use it in GitHub Desktop.
This file contains 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
# Set docker-compose version | |
version: '3' | |
services: | |
postgres: | |
container_name: postgres | |
ports: | |
- "5432:5432" | |
volumes: | |
- $HOME/postgres-data:/var/lib/postgresql | |
image: postgres:9.6.9 | |
elasticsearch: | |
container_name: elasticsearch | |
ports: | |
- "9200:9200" | |
volumes: | |
- $HOME/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml | |
- $HOME/elasticsearch/data:/usr/share/elasticsearch/data | |
links: | |
- postgres | |
image: elasticsearch:5.2.1 | |
redis: | |
container_name: redis | |
ports: | |
- "6379:6379" | |
links: | |
- postgres | |
image: redis:5.0-rc | |
web: | |
container_name: web | |
build: . | |
ports: | |
- "3000:3000" | |
command: /bin/sh -c "rails s -b 0.0.0.0 -p 3000" | |
volumes: | |
- .:/app | |
depends_on: | |
- postgres | |
- redis | |
- elasticsearch | |
# Environment variables that allow my app to find other services | |
environment: | |
REDISTOGO_URL: "redis://redis:6379" | |
POSTGRES_USER: postgres | |
POSTGRES_HOST: postgres | |
ELASTICSEARCH_URL: "http://elasticsearch:9200" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment