Last active
November 26, 2019 20:12
-
-
Save jayjanssen/13de7a978a380508f0c8c2fc14ce373d to your computer and use it in GitHub Desktop.
Shared local rack resources for Convox gen2
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
# NOT FOR PRODUCTION, JUST FOR LOCAL RACKS!!!!! | |
# I use this convox.yml to setup local gen2 rack services. | |
# NOT for apps that have their own resources defined, these are resources are shared across multiple apps | |
# In production, these are either non-convox SaaS (e.g., I use Elastic cloud for my prod elasticsearch) | |
# *or* I set them up with `convox resources create` (e.g., my shared redis) | |
# This config is just a handy way to have local dev services running that my local convox rack can use. | |
resources: | |
# Any resources here exposed locally as <resourcename>.resource.<appname>.convox | |
redis: | |
type: redis | |
services: | |
# Works for any docker container that exposes HTTP | |
# Any services here exposed locally as <servicename>.<appname>.convox | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.1 | |
port: 9200 | |
volumes: | |
- elk-data:/usr/share/elasticsearch/data | |
kibana: | |
image: docker.elastic.co/kibana/kibana:6.5.1 | |
port: 5601 | |
environment: | |
- ELASTICSEARCH_URL="http://elasticsearch.shared-resources.convox:80" | |
- LOGGING_QUIET=true | |
sqs: | |
image: lightspeedretail/fake-sqs | |
port: 9324 | |
environment: | |
- LINK_SCHEME=http | |
- LINK_PASSWORD=test | |
- LINK_USERNAME=test | |
- LINK_PATH=/queue/default | |
- QUEUE_DEFAULT_VISIBILITY_TIMEOUT=2 | |
- QUEUE_DELAY=0 |
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
# convox switch local rack | |
$ cd shared-resources; convox deploy | |
# ... wait | |
$ convox services | |
SERVICE DOMAIN PORTS | |
elasticsearch elasticsearch.shared-resources.convox 80:9200 443:9200 | |
kibana kibana.shared-resources.convox 80:5601 443:5601 | |
sqs sqs.shared-resources.convox 80:9324 443:9324 | |
# Access from local machine: | |
$ curl elasticsearch.shared-resources.convox | |
{ | |
"name" : "mzk5BrN", | |
"cluster_name" : "docker-cluster", | |
"cluster_uuid" : "lROw8o5rRY2u3QEBJIPSoA", | |
"version" : { | |
"number" : "6.5.1", | |
"build_flavor" : "default", | |
"build_type" : "tar", | |
"build_hash" : "8c58350", | |
"build_date" : "2018-11-16T02:22:42.182257Z", | |
"build_snapshot" : false, | |
"lucene_version" : "7.5.0", | |
"minimum_wire_compatibility_version" : "5.6.0", | |
"minimum_index_compatibility_version" : "5.0.0" | |
}, | |
"tagline" : "You Know, for Search" | |
} | |
# Resources available at <resourcename>.resource.shared-resources.convox | |
$ redis-cli -h redis.resource.perconabot-resources.convox | |
redis.resource.perconabot-resources.convox:6379> info | |
# Server | |
redis_version:3.2.0 | |
redis_git_sha1:45b825e3 | |
redis_git_dirty:0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment