Permalink
Browse files

more starter files

  • Loading branch information...
BretFisher committed Jun 3, 2018
1 parent ebb5202 commit 164fc9097488d11e735ee2a6a97f09f512ae3159
Showing with 752 additions and 0 deletions.
  1. +20 −0 create-servers.sh
  2. +3 −0 create-swarm.sh
  3. +4 −0 daemon.json
  4. +80 −0 stack-elk.yml
  5. +65 −0 stack-ghost.yml
  6. +26 −0 stack-menu.yml
  7. +136 −0 stack-portus.yml
  8. +51 −0 stack-proxy.yml
  9. +11 −0 stack-prune.yml
  10. +249 −0 stack-swarmprom.yml
  11. +27 −0 stack-visualizer.yml
  12. +80 −0 stack-voting.yml
@@ -0,0 +1,20 @@
#!/bin/bash

# create managers servers
for server in 1 2 3 4 5; do
docker-machine create \
--driver=digitalocean \
--digitalocean-access-token="${DO_TOKEN}" \
--digitalocean-size="${DO_SIZE}" \
--digitalocean-private-networking=true \
--digitalocean-ssh-key-fingerprint="${SSH_FINGERPRINT}" \
--digitalocean-tags=dogvscat \
dvc${server} &
done

# create servers





@@ -0,0 +1,3 @@
#!/sh/bash
docker-machine ssh dvc1 docker swarm init --listen-addr=eth1 --data-path-addr=eth1 --advertise-addr=eth1

@@ -0,0 +1,4 @@
{
"metrics-addr" : "0.0.0.0:9323",
"experimental" : true
}
@@ -0,0 +1,80 @@
version: '3.5'

services:

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2
configs:
- source: elastic_config
target: /usr/share/elasticsearch/config/elasticsearch.yml
environment:
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
- elk
volumes:
- elasticsearch:/usr/share/elasticsearch/data
deploy:
mode: replicated
replicas: 1

logstash:
image: docker.elastic.co/logstash/logstash-oss:6.2.2
ports:
- "5000:5000"
- "9600:9600"
configs:
- source: logstash_config
target: /usr/share/logstash/config/logstash.yml
- source: logstash_pipeline-2
target: /usr/share/logstash/pipeline/logstash.conf
environment:
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
- elk
- logging
deploy:
mode: replicated
replicas: 1

kibana:
image: docker.elastic.co/kibana/kibana-oss:6.2.2
configs:
- source: kibana_config
target: /usr/share/kibana/config/kibana.yml
networks:
- elk
- proxy
deploy:
mode: replicated
replicas: 1
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.serviceDomain=kibana.dogvs.cat
- com.df.port=5601
- com.df.users=${ADMIN_USER:-admin}:${ADMIN_PASSWORD:-admin}


configs:

elastic_config:
file: ./docker-elk/elasticsearch/config/elasticsearch.yml
logstash_config:
file: ./docker-elk/logstash/config/logstash.yml
logstash_pipeline-2:
file: ./docker-elk/logstash/pipeline/logstash.conf
kibana_config:
file: ./docker-elk/kibana/config/kibana.yml

networks:
elk:
proxy:
external: true
logging:
external: true

volumes:
elasticsearch:
driver: rexray/dobs
driver_opts:
size: 10
@@ -0,0 +1,65 @@
version: '3.5'

services:

ghost:
image: ghost:1-alpine
networks:
- proxy
- ghost
- logging
environment:
# see https://docs.ghost.org/docs/config#section-running-ghost-with-config-env-variables
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: OpdP2dy4jzAT
database__connection__database: ghost
url: http://ghost.dogvs.cat
deploy:
replicas: 2
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.serviceDomain=ghost.dogvs.cat
- com.df.port=2368
logging:
driver: "gelf"
options:
gelf-address: "udp://127.0.0.1:18201"

db:
image: mysql:5.7
volumes:
- db:/var/lib/mysql
secrets:
- db-password
networks:
- ghost
- logging
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db-password
logging:
driver: "gelf"
options:
gelf-address: "udp://127.0.0.1:18201"

networks:
ghost: {}
proxy:
external: true
logging:
external: true

volumes:
db:
driver: rexray/dobs
driver_opts:
size: 1

secrets:
db-password:
file: ./secret-ghost-db



@@ -0,0 +1,26 @@
version: '3.4'

services:

menu:
image: bretfisher/dogvscat-menu
build:
context: menu
deploy:
replicas: 3
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.serviceDomain=www.dogvs.cat,dogvs.cat
- com.df.port=80
networks:
- proxy
logging:
driver: "gelf"
options:
gelf-address: "udp://127.0.0.1:18201"

networks:
proxy:
external: true

@@ -0,0 +1,136 @@
version: '3'

services:

viz:
image: portainer/portainer
deploy:
replicas: 1
placement:
constraints: [node.role == manager]
labels:
- com.df.notify=true
- com.df.distribute=true
- com.df.serviceDomain=portainer.dogvs.cat
- com.df.port=9000
networks:
- proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
logging:
driver: "gelf"
options:
gelf-address: "udp://127.0.0.1:18201"

networks:
proxy:
external: true

portus:
build: .
image: opensuse/portus:development
command: bundle exec rails runner /srv/Portus/examples/development/compose/init.rb
environment:
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
- PORTUS_PUMA_HOST=0.0.0.0:3000
- PORTUS_CHECK_SSL_USAGE_ENABLED=false
- PORTUS_SECURITY_CLAIR_SERVER=http://clair:6060

- CCONFIG_PREFIX=PORTUS

- PORTUS_DB_HOST=db
- PORTUS_DB_PASSWORD=portus
- PORTUS_DB_POOL=5

- RAILS_SERVE_STATIC_FILES=true
ports:
- 3000:3000
depends_on:
- db
links:
- db
volumes:
- .:/srv/Portus

background:
image: opensuse/portus:development
entrypoint: bundle exec rails runner /srv/Portus/bin/background.rb
depends_on:
- portus
- db
environment:
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
- PORTUS_SECURITY_CLAIR_SERVER=http://clair:6060

# Theoretically not needed, but cconfig's been buggy on this...
- CCONFIG_PREFIX=PORTUS

- PORTUS_DB_HOST=db
- PORTUS_DB_PASSWORD=portus
- PORTUS_DB_POOL=5
volumes:
- .:/srv/Portus
links:
- db

webpack:
image: kkarczmarczyk/node-yarn:6.9-slim
command: bash /srv/Portus/examples/development/compose/bootstrap-webpack
working_dir: /srv/Portus
volumes:
- .:/srv/Portus

clair:
image: quay.io/coreos/clair:v2.0.2
restart: unless-stopped
depends_on:
- postgres
links:
- postgres
ports:
- "6060-6061:6060-6061"
volumes:
- /tmp:/tmp
- ./examples/compose/clair/clair.yml:/clair.yml
command: [-config, /clair.yml]

db:
image: library/mariadb:10.0.23
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
environment:
MYSQL_ROOT_PASSWORD: portus

postgres:
image: library/postgres:10-alpine
environment:
POSTGRES_PASSWORD: portus

registry:
image: library/registry:2.6
environment:
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /registry_data
REGISTRY_STORAGE_DELETE_ENABLED: "true"

REGISTRY_HTTP_ADDR: 0.0.0.0:5000
REGISTRY_HTTP_DEBUG_ADDR: 0.0.0.0:5001

REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE: /etc/docker/registry/portus.crt

REGISTRY_AUTH_TOKEN_REALM: http://${MACHINE_FQDN}:3000/v2/token
REGISTRY_AUTH_TOKEN_SERVICE: ${MACHINE_FQDN}:${REGISTRY_PORT}
REGISTRY_AUTH_TOKEN_ISSUER: ${MACHINE_FQDN}

REGISTRY_NOTIFICATIONS_ENDPOINTS: >
- name: portus
url: http://${MACHINE_FQDN}:3000/v2/webhooks/events
timeout: 2000ms
threshold: 5
backoff: 1s
volumes:
- /registry_data
- ./examples/development/compose/portus.crt:/etc/docker/registry/portus.crt:ro
ports:
- ${REGISTRY_PORT}:5000
- 5001:5001
links:
- portus
@@ -0,0 +1,51 @@
version: '3.3'

services:

proxy:
image: vfarcic/docker-flow-proxy
ports:
- '80:80'
- '443:443'
networks:
- proxy
environment:
LISTENER_ADDRESS: "swarm-listener"
MODE: "swarm"
DEBUG: "true"
# secrets:
# - cert-docker-dev
deploy:
mode: global
logging:
driver: "gelf"
options:
gelf-address: "udp://127.0.0.1:18201"

swarm-listener:
image: vfarcic/docker-flow-swarm-listener
networks:
- proxy
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
environment:
- >-
DF_NOTIFY_CREATE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/reconfigure
- >-
DF_NOTIFY_REMOVE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/remove
deploy:
placement:
constraints:
- node.role == manager
logging:
driver: "gelf"
options:
gelf-address: "udp://127.0.0.1:18201"


networks:
proxy:
external: true
# secrets:
# cert-docker-dev:
# file: ./nginx/dev-full.pem
Oops, something went wrong.

0 comments on commit 164fc90

Please sign in to comment.