Skip to content

Commit 164fc90

Browse files
committed
more starter files
1 parent ebb5202 commit 164fc90

12 files changed

+752
-0
lines changed

create-servers.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# create managers servers
4+
for server in 1 2 3 4 5; do
5+
docker-machine create \
6+
--driver=digitalocean \
7+
--digitalocean-access-token="${DO_TOKEN}" \
8+
--digitalocean-size="${DO_SIZE}" \
9+
--digitalocean-private-networking=true \
10+
--digitalocean-ssh-key-fingerprint="${SSH_FINGERPRINT}" \
11+
--digitalocean-tags=dogvscat \
12+
dvc${server} &
13+
done
14+
15+
# create servers
16+
17+
18+
19+
20+

create-swarm.sh

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

daemon.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"metrics-addr" : "0.0.0.0:9323",
3+
"experimental" : true
4+
}

stack-elk.yml

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
version: '3.5'
2+
3+
services:
4+
5+
elasticsearch:
6+
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2
7+
configs:
8+
- source: elastic_config
9+
target: /usr/share/elasticsearch/config/elasticsearch.yml
10+
environment:
11+
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
12+
networks:
13+
- elk
14+
volumes:
15+
- elasticsearch:/usr/share/elasticsearch/data
16+
deploy:
17+
mode: replicated
18+
replicas: 1
19+
20+
logstash:
21+
image: docker.elastic.co/logstash/logstash-oss:6.2.2
22+
ports:
23+
- "5000:5000"
24+
- "9600:9600"
25+
configs:
26+
- source: logstash_config
27+
target: /usr/share/logstash/config/logstash.yml
28+
- source: logstash_pipeline-2
29+
target: /usr/share/logstash/pipeline/logstash.conf
30+
environment:
31+
LS_JAVA_OPTS: "-Xmx256m -Xms256m"
32+
networks:
33+
- elk
34+
- logging
35+
deploy:
36+
mode: replicated
37+
replicas: 1
38+
39+
kibana:
40+
image: docker.elastic.co/kibana/kibana-oss:6.2.2
41+
configs:
42+
- source: kibana_config
43+
target: /usr/share/kibana/config/kibana.yml
44+
networks:
45+
- elk
46+
- proxy
47+
deploy:
48+
mode: replicated
49+
replicas: 1
50+
labels:
51+
- com.df.notify=true
52+
- com.df.distribute=true
53+
- com.df.serviceDomain=kibana.dogvs.cat
54+
- com.df.port=5601
55+
- com.df.users=${ADMIN_USER:-admin}:${ADMIN_PASSWORD:-admin}
56+
57+
58+
configs:
59+
60+
elastic_config:
61+
file: ./docker-elk/elasticsearch/config/elasticsearch.yml
62+
logstash_config:
63+
file: ./docker-elk/logstash/config/logstash.yml
64+
logstash_pipeline-2:
65+
file: ./docker-elk/logstash/pipeline/logstash.conf
66+
kibana_config:
67+
file: ./docker-elk/kibana/config/kibana.yml
68+
69+
networks:
70+
elk:
71+
proxy:
72+
external: true
73+
logging:
74+
external: true
75+
76+
volumes:
77+
elasticsearch:
78+
driver: rexray/dobs
79+
driver_opts:
80+
size: 10

stack-ghost.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: '3.5'
2+
3+
services:
4+
5+
ghost:
6+
image: ghost:1-alpine
7+
networks:
8+
- proxy
9+
- ghost
10+
- logging
11+
environment:
12+
# see https://docs.ghost.org/docs/config#section-running-ghost-with-config-env-variables
13+
database__client: mysql
14+
database__connection__host: db
15+
database__connection__user: root
16+
database__connection__password: OpdP2dy4jzAT
17+
database__connection__database: ghost
18+
url: http://ghost.dogvs.cat
19+
deploy:
20+
replicas: 2
21+
labels:
22+
- com.df.notify=true
23+
- com.df.distribute=true
24+
- com.df.serviceDomain=ghost.dogvs.cat
25+
- com.df.port=2368
26+
logging:
27+
driver: "gelf"
28+
options:
29+
gelf-address: "udp://127.0.0.1:18201"
30+
31+
db:
32+
image: mysql:5.7
33+
volumes:
34+
- db:/var/lib/mysql
35+
secrets:
36+
- db-password
37+
networks:
38+
- ghost
39+
- logging
40+
environment:
41+
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db-password
42+
logging:
43+
driver: "gelf"
44+
options:
45+
gelf-address: "udp://127.0.0.1:18201"
46+
47+
networks:
48+
ghost: {}
49+
proxy:
50+
external: true
51+
logging:
52+
external: true
53+
54+
volumes:
55+
db:
56+
driver: rexray/dobs
57+
driver_opts:
58+
size: 1
59+
60+
secrets:
61+
db-password:
62+
file: ./secret-ghost-db
63+
64+
65+

stack-menu.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: '3.4'
2+
3+
services:
4+
5+
menu:
6+
image: bretfisher/dogvscat-menu
7+
build:
8+
context: menu
9+
deploy:
10+
replicas: 3
11+
labels:
12+
- com.df.notify=true
13+
- com.df.distribute=true
14+
- com.df.serviceDomain=www.dogvs.cat,dogvs.cat
15+
- com.df.port=80
16+
networks:
17+
- proxy
18+
logging:
19+
driver: "gelf"
20+
options:
21+
gelf-address: "udp://127.0.0.1:18201"
22+
23+
networks:
24+
proxy:
25+
external: true
26+

stack-portus.yml

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
version: '3'
2+
3+
services:
4+
5+
viz:
6+
image: portainer/portainer
7+
deploy:
8+
replicas: 1
9+
placement:
10+
constraints: [node.role == manager]
11+
labels:
12+
- com.df.notify=true
13+
- com.df.distribute=true
14+
- com.df.serviceDomain=portainer.dogvs.cat
15+
- com.df.port=9000
16+
networks:
17+
- proxy
18+
volumes:
19+
- /var/run/docker.sock:/var/run/docker.sock
20+
logging:
21+
driver: "gelf"
22+
options:
23+
gelf-address: "udp://127.0.0.1:18201"
24+
25+
networks:
26+
proxy:
27+
external: true
28+
29+
portus:
30+
build: .
31+
image: opensuse/portus:development
32+
command: bundle exec rails runner /srv/Portus/examples/development/compose/init.rb
33+
environment:
34+
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
35+
- PORTUS_PUMA_HOST=0.0.0.0:3000
36+
- PORTUS_CHECK_SSL_USAGE_ENABLED=false
37+
- PORTUS_SECURITY_CLAIR_SERVER=http://clair:6060
38+
39+
- CCONFIG_PREFIX=PORTUS
40+
41+
- PORTUS_DB_HOST=db
42+
- PORTUS_DB_PASSWORD=portus
43+
- PORTUS_DB_POOL=5
44+
45+
- RAILS_SERVE_STATIC_FILES=true
46+
ports:
47+
- 3000:3000
48+
depends_on:
49+
- db
50+
links:
51+
- db
52+
volumes:
53+
- .:/srv/Portus
54+
55+
background:
56+
image: opensuse/portus:development
57+
entrypoint: bundle exec rails runner /srv/Portus/bin/background.rb
58+
depends_on:
59+
- portus
60+
- db
61+
environment:
62+
- PORTUS_MACHINE_FQDN_VALUE=${MACHINE_FQDN}
63+
- PORTUS_SECURITY_CLAIR_SERVER=http://clair:6060
64+
65+
# Theoretically not needed, but cconfig's been buggy on this...
66+
- CCONFIG_PREFIX=PORTUS
67+
68+
- PORTUS_DB_HOST=db
69+
- PORTUS_DB_PASSWORD=portus
70+
- PORTUS_DB_POOL=5
71+
volumes:
72+
- .:/srv/Portus
73+
links:
74+
- db
75+
76+
webpack:
77+
image: kkarczmarczyk/node-yarn:6.9-slim
78+
command: bash /srv/Portus/examples/development/compose/bootstrap-webpack
79+
working_dir: /srv/Portus
80+
volumes:
81+
- .:/srv/Portus
82+
83+
clair:
84+
image: quay.io/coreos/clair:v2.0.2
85+
restart: unless-stopped
86+
depends_on:
87+
- postgres
88+
links:
89+
- postgres
90+
ports:
91+
- "6060-6061:6060-6061"
92+
volumes:
93+
- /tmp:/tmp
94+
- ./examples/compose/clair/clair.yml:/clair.yml
95+
command: [-config, /clair.yml]
96+
97+
db:
98+
image: library/mariadb:10.0.23
99+
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
100+
environment:
101+
MYSQL_ROOT_PASSWORD: portus
102+
103+
postgres:
104+
image: library/postgres:10-alpine
105+
environment:
106+
POSTGRES_PASSWORD: portus
107+
108+
registry:
109+
image: library/registry:2.6
110+
environment:
111+
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /registry_data
112+
REGISTRY_STORAGE_DELETE_ENABLED: "true"
113+
114+
REGISTRY_HTTP_ADDR: 0.0.0.0:5000
115+
REGISTRY_HTTP_DEBUG_ADDR: 0.0.0.0:5001
116+
117+
REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE: /etc/docker/registry/portus.crt
118+
119+
REGISTRY_AUTH_TOKEN_REALM: http://${MACHINE_FQDN}:3000/v2/token
120+
REGISTRY_AUTH_TOKEN_SERVICE: ${MACHINE_FQDN}:${REGISTRY_PORT}
121+
REGISTRY_AUTH_TOKEN_ISSUER: ${MACHINE_FQDN}
122+
123+
REGISTRY_NOTIFICATIONS_ENDPOINTS: >
124+
- name: portus
125+
url: http://${MACHINE_FQDN}:3000/v2/webhooks/events
126+
timeout: 2000ms
127+
threshold: 5
128+
backoff: 1s
129+
volumes:
130+
- /registry_data
131+
- ./examples/development/compose/portus.crt:/etc/docker/registry/portus.crt:ro
132+
ports:
133+
- ${REGISTRY_PORT}:5000
134+
- 5001:5001
135+
links:
136+
- portus

stack-proxy.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: '3.3'
2+
3+
services:
4+
5+
proxy:
6+
image: vfarcic/docker-flow-proxy
7+
ports:
8+
- '80:80'
9+
- '443:443'
10+
networks:
11+
- proxy
12+
environment:
13+
LISTENER_ADDRESS: "swarm-listener"
14+
MODE: "swarm"
15+
DEBUG: "true"
16+
# secrets:
17+
# - cert-docker-dev
18+
deploy:
19+
mode: global
20+
logging:
21+
driver: "gelf"
22+
options:
23+
gelf-address: "udp://127.0.0.1:18201"
24+
25+
swarm-listener:
26+
image: vfarcic/docker-flow-swarm-listener
27+
networks:
28+
- proxy
29+
volumes:
30+
- '/var/run/docker.sock:/var/run/docker.sock'
31+
environment:
32+
- >-
33+
DF_NOTIFY_CREATE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/reconfigure
34+
- >-
35+
DF_NOTIFY_REMOVE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/remove
36+
deploy:
37+
placement:
38+
constraints:
39+
- node.role == manager
40+
logging:
41+
driver: "gelf"
42+
options:
43+
gelf-address: "udp://127.0.0.1:18201"
44+
45+
46+
networks:
47+
proxy:
48+
external: true
49+
# secrets:
50+
# cert-docker-dev:
51+
# file: ./nginx/dev-full.pem

0 commit comments

Comments
 (0)