A docker collection with composer for a fast start-up.
- Each service folder has its own README.
use docker-swarm to manage and start containers.
for that is in each service following defined:
services:
...:
...
deploy:
mode: replicated
replicas: 1
placement:
max_replicas_per_node: 1
constraints:
# - "node.id==${NODE_ID}"
- "node.role==${NODE_ROLE}"
restart_policy:
condition: on-failure
...
ports:
- target: ...
published: ...
mode: host
to start this configuration with all supportings between docker-stack and docker-composer run it example as follow:
create alias for a docker-swarm
command:
$alias docker='DOCKER_BUILDKIT=1 docker'
$alias docker-compose='docker compose'
$alias docker-swarm-compose='docker compose --compatibility config | sed '\''s|cpus: \([0-9]\+\(\.[0-9]\+\)*\)|cpus: "\1"|'\'' | sed '\''1{/^name:/d}'\'' | sed '\''s/published: "\(.*\)"/published: \1/'\'' | docker stack deploy --resolve-image=never --with-registry-auth --compose-file -'
and as run:
$docker-swarm-compose <STACK_NAME>
- Not included
☕ COFFEE is a HUG in a MUG ☕