Skip to content

Instantly share code, notes, and snippets.

View elqahtani's full-sized avatar
🏠
Working from home

Huda Ridwan elqahtani

🏠
Working from home
View GitHub Profile
@elqahtani
elqahtani / Dockerfile
Created August 13, 2020 14:35 — forked from thom-nic/Dockerfile
Dockerfile that attempts to run the app as non-root user. This creates a `node` user & sets permissions on app files. Note you cannot `chown` files in a docker 'volume' during the build process, but you can at runtime (as part of your `CMD`) but in that case you can't use the `USER` command to change the UID before `CMD` runs.
###
# Node.js app Docker file
#
# Some basic build instructions:
# ```
# # you should delete node_modules b/c you don't want that copied during 'ADD'
# docker build -t thom-nic/node-bootstrap .
# # run a shell in the container to inspect the environment (as root):
# docker run --rm -itu root thom-nic/node-bootstrap /bin/bash
# ```
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.
// This used to use jQuery, but was rewritten in plan DOM for speed and to get rid of the jQuery dependency.
document.addEventListener('DOMContentLoaded', function() {
// Click handler for collapsing and expanding objects and arrays
function collapse(evt) {
var collapser = evt.target;
var target = collapser.parentNode.getElementsByClassName('collapsible');
if ( ! target.length ) {
return;
body {
font-family: sans-serif;
}
a, a:hover, a:link {
color: #0000EE;
font-style: none;
}
.prop {