Add some docker magick to drb_counter
This commit is contained in:
@@ -71,7 +71,8 @@ class InMemoryQCounter
|
|||||||
puts "Environment: #{environment.inspect}"
|
puts "Environment: #{environment.inspect}"
|
||||||
#couch_settings = YAML.load_file(couch_settings_path)[environment]
|
#couch_settings = YAML.load_file(couch_settings_path)[environment]
|
||||||
couch_settings = YAML.safe_load(ERB.new(File.read(couch_settings_path)).result, [Symbol], [], ['default'])[environment]
|
couch_settings = YAML.safe_load(ERB.new(File.read(couch_settings_path)).result, [Symbol], [], ['default'])[environment]
|
||||||
database = couch_settings['database']
|
database = couch_settings['database'].sub 'localhost', 'host.docker.internal'
|
||||||
|
#database = couch_settings['database'].sub 'localhost', '172.17.0.1'
|
||||||
db = CouchRest.database(database) # for debug: db = CouchPotato.database.couchrest_database
|
db = CouchRest.database(database) # for debug: db = CouchPotato.database.couchrest_database
|
||||||
design_doc = "_design/order_counter"
|
design_doc = "_design/order_counter"
|
||||||
view_path = File.join design_doc, "_view/by_supplier_id_and_state"
|
view_path = File.join design_doc, "_view/by_supplier_id_and_state"
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ docker rmi mozo_drb_counter
|
|||||||
docker build -f drb_counter/Dockerfile -t mozo_drb_counter .
|
docker build -f drb_counter/Dockerfile -t mozo_drb_counter .
|
||||||
|
|
||||||
# debug docker and enter the bash:
|
# debug docker and enter the bash:
|
||||||
# docker run --network=host --env DRB_ENV=production -t -i --rm mozo_drb_counter bash
|
# docker run --network=host --env DRB_ENV=production --env COUCHDB_ADMIN_PASSWORD=$COUCHDB_ADMIN_PASSWORD -t -i --rm mozo_drb_counter bash
|
||||||
|
|
||||||
# 5. Spin up the counter container from the generated image
|
# 5. Spin up the counter container from the generated image
|
||||||
docker run --network=host --env DRB_ENV=production --env COUCHDB_ADMIN_PASSWORD=$COUCHDB_ADMIN_PASSWORD --restart unless-stopped --detach --name=mozo_drb_counter mozo_drb_counter
|
docker run --network=host --env DRB_ENV=production --env COUCHDB_ADMIN_PASSWORD=$COUCHDB_ADMIN_PASSWORD --add-host=host.docker.internal:host-gateway --restart unless-stopped --detach --name=mozo_drb_counter mozo_drb_counter
|
||||||
|
|
||||||
# To just start the container created through al these steps without rebuilding them:
|
# To just start the container created through al these steps without rebuilding them:
|
||||||
# docker container start $(docker ps -a -q --filter ancestor=mozo_drb_counter)
|
# docker container start $(docker ps -a -q --filter ancestor=mozo_drb_counter)
|
||||||
|
|||||||
Reference in New Issue
Block a user