Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active September 7, 2017 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/3ba79733a1f212f92d42e09416575c65 to your computer and use it in GitHub Desktop.
Save garystafford/3ba79733a1f212f92d42e09416575c65 to your computer and use it in GitHub Desktop.
# Hello World Service Stack
# DTR_URL: Docker Trusted Registry URL
# IMAGE: Docker Image to deply
# ENVIRONMENT: Environment to deploy into
version: '3.2'
services:
hello-world:
image: ${DTR_URL}/${IMAGE}
deploy:
placement:
constraints:
- node.role == worker
- node.labels.environment == ${ENVIRONMENT}
replicas: 4
update_config:
parallelism: 4
delay: 10s
restart_policy:
condition: any
max_attempts: 3
delay: 10s
logging:
driver: fluentd
options:
tag: docker.{{.Name}}
env: SERVICE_NAME,ENVIRONMENT
environment:
SERVICE_NAME: hello-world
ENVIRONMENT: ${ENVIRONMENT}
command: "java \
-Dspring.profiles.active=${ENVIRONMENT} \
-Djava.security.egd=file:/dev/./urandom \
-jar hello-world.jar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment