refactor docker swarm to use just home without workers for now
add caching at nginx level for portainer and gitea
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@
|
|||||||
backups/
|
backups/
|
||||||
.idea/
|
.idea/
|
||||||
roles/vendor/
|
roles/vendor/
|
||||||
|
/dockerfiles/services/nextcloud/config/config.php
|
||||||
|
|||||||
@@ -65,6 +65,15 @@
|
|||||||
prometheus:
|
prometheus:
|
||||||
host: gluster:/prometheus
|
host: gluster:/prometheus
|
||||||
mount: /opt/prometheus
|
mount: /opt/prometheus
|
||||||
|
nextcloud:
|
||||||
|
host: gluster:/nextcloud
|
||||||
|
mount: /opt/nextcloud
|
||||||
|
mariadb:
|
||||||
|
host: gluster:/mariadb
|
||||||
|
mount: /opt/mariadb
|
||||||
|
postgresql:
|
||||||
|
host: gluster:/postgresql
|
||||||
|
mount: /opt/postgresql
|
||||||
gluster_remove:
|
gluster_remove:
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
host: gluster:/elasticsearch
|
host: gluster:/elasticsearch
|
||||||
|
|||||||
@@ -38,13 +38,10 @@ services:
|
|||||||
fluentd-async-connect: 'true'
|
fluentd-async-connect: 'true'
|
||||||
tag: gitea
|
tag: gitea
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- prod_ui
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
prod_ui:
|
||||||
external:
|
external:
|
||||||
name: ingress
|
name: prod_ui
|
||||||
ingress:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
prod:
|
|
||||||
external:
|
|
||||||
name: prod
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ docker login -u richard -p $DKREGISTRY_PASS $DKREGISTRY
|
|||||||
|
|
||||||
docker stack deploy --with-registry-auth --prune -c gitea/docker-compose.yml gitea
|
docker stack deploy --with-registry-auth --prune -c gitea/docker-compose.yml gitea
|
||||||
|
|
||||||
docker stack deploy --with-registry-auth --prune -c nextcloud/docker-compose-prod.yml nextcloud
|
docker stack deploy --with-registry-auth --prune -c nextcloud/docker-compose-prod.yml xaibox
|
||||||
|
|
||||||
docker stack deploy --with-registry-auth --prune -c ui/docker-compose.yml dkui
|
docker stack deploy --with-registry-auth --prune -c ui/docker-compose.yml dkui
|
||||||
|
|
||||||
docker stack deploy --with-registry-auth --prune -c sslproxy/docker-compose-prod.yml sslproxy
|
docker stack deploy --with-registry-auth --prune -c sslproxy/docker-compose-prod.yml sslproxy
|
||||||
|
|
||||||
docker stack deploy --with-registry-auth --prune -c letsencrypt/docker-compose-update.yml letsencrypt
|
#docker stack deploy --with-registry-auth --prune -c letsencrypt/docker-compose-update.yml letsencrypt
|
||||||
|
|
||||||
docker stack deploy --with-registry-auth --prune -c prometheus/docker-compose-prod.yml metrics
|
#docker stack deploy --with-registry-auth --prune -c prometheus/docker-compose-prod.yml metrics
|
||||||
|
|||||||
2
dockerfiles/services/nextcloud/.dockerignore
Normal file
2
dockerfiles/services/nextcloud/.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
config/config.php
|
||||||
|
data
|
||||||
4
dockerfiles/services/nextcloud/Dockerfile
Normal file → Executable file
4
dockerfiles/services/nextcloud/Dockerfile
Normal file → Executable file
@@ -1,3 +1,7 @@
|
|||||||
FROM nextcloud:13-fpm
|
FROM nextcloud:13-fpm
|
||||||
|
#FROM nextcloud:stable-apache
|
||||||
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y smbclient && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y smbclient && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY php/errorlog.conf /usr/local/etc/php-fpm.d/errorlog.conf
|
||||||
|
|||||||
0
dockerfiles/services/nextcloud/Dockerfile-web
Normal file → Executable file
0
dockerfiles/services/nextcloud/Dockerfile-web
Normal file → Executable file
15
dockerfiles/services/nextcloud/config/apps.config.php
Executable file
15
dockerfiles/services/nextcloud/config/apps.config.php
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
$CONFIG = array (
|
||||||
|
"apps_paths" => array (
|
||||||
|
0 => array (
|
||||||
|
"path" => OC::$SERVERROOT."/apps",
|
||||||
|
"url" => "/apps",
|
||||||
|
"writable" => false,
|
||||||
|
),
|
||||||
|
1 => array (
|
||||||
|
"path" => OC::$SERVERROOT."/custom_apps",
|
||||||
|
"url" => "/custom_apps",
|
||||||
|
"writable" => true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
42
dockerfiles/services/nextcloud/config/cache.config.php
Executable file
42
dockerfiles/services/nextcloud/config/cache.config.php
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$CONFIG = [
|
||||||
|
'memcache.local' => '\OC\Memcache\APCu',
|
||||||
|
|
||||||
|
'memcache.distributed' => '\OC\Memcache\Redis',
|
||||||
|
|
||||||
|
'memcache.locking' => '\OC\Memcache\Redis',
|
||||||
|
|
||||||
|
'redis' => [
|
||||||
|
'host' => getenv('REDISHOST'), // can also be a unix domain socket: '/tmp/redis.sock'
|
||||||
|
'port' => getenv('REDISPORT'),
|
||||||
|
'timeout' => 0.0,
|
||||||
|
'password' => '', // Optional, if not defined no password will be used.
|
||||||
|
'dbindex' => 0, // Optional, if undefined SELECT will not run and will use Redis Server's default DB Index.
|
||||||
|
],
|
||||||
|
|
||||||
|
'memcached_servers' => [
|
||||||
|
['memcached', 11211],
|
||||||
|
],
|
||||||
|
|
||||||
|
'memcached_options' => array(
|
||||||
|
// Set timeouts to 50ms
|
||||||
|
\Memcached::OPT_CONNECT_TIMEOUT => 50,
|
||||||
|
\Memcached::OPT_RETRY_TIMEOUT => 50,
|
||||||
|
\Memcached::OPT_SEND_TIMEOUT => 50,
|
||||||
|
\Memcached::OPT_RECV_TIMEOUT => 50,
|
||||||
|
\Memcached::OPT_POLL_TIMEOUT => 50,
|
||||||
|
|
||||||
|
// Enable compression
|
||||||
|
\Memcached::OPT_COMPRESSION => true,
|
||||||
|
|
||||||
|
// Turn on consistent hashing
|
||||||
|
\Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
|
||||||
|
|
||||||
|
// Enable Binary Protocol
|
||||||
|
\Memcached::OPT_BINARY_PROTOCOL => true,
|
||||||
|
|
||||||
|
// Binary serializer vill be enabled if the igbinary PECL module is available
|
||||||
|
//\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY,
|
||||||
|
),
|
||||||
|
];
|
||||||
14
dockerfiles/services/nextcloud/config/db.config.php
Executable file
14
dockerfiles/services/nextcloud/config/db.config.php
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$CONFIG = [
|
||||||
|
'dbtype' => getenv('DBTYPE'),
|
||||||
|
'dbhost' => getenv('DBHOST') .':'. getenv('DBPORT'),
|
||||||
|
|
||||||
|
'dbname' => getenv('DBNAME'),
|
||||||
|
|
||||||
|
'dbuser' => getenv('DBUSER'),
|
||||||
|
'dbpassword' => getenv('DBPASS'),
|
||||||
|
|
||||||
|
'dbtableprefix' => 'oc_',
|
||||||
|
'mysql.utf8mb4' => true,
|
||||||
|
];
|
||||||
7
dockerfiles/services/nextcloud/config/logging.config.php
Executable file
7
dockerfiles/services/nextcloud/config/logging.config.php
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$CONFIG = [
|
||||||
|
'log_type' => 'errorlog',
|
||||||
|
|
||||||
|
'loglevel' => getenv('LOGLEVEL'),
|
||||||
|
];
|
||||||
19
dockerfiles/services/nextcloud/config/maintenance.config.php
Executable file
19
dockerfiles/services/nextcloud/config/maintenance.config.php
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$CONFIG = [
|
||||||
|
// 'maintenance' => false,
|
||||||
|
// 'theme' => '',
|
||||||
|
//
|
||||||
|
// 'installed' => false,
|
||||||
|
//
|
||||||
|
// 'instanceid' => 'ocxziwl6co38',
|
||||||
|
// 'passwordsalt' => 'FKWh+oXeNAm2EPHg6mz+9xE48gunGb',
|
||||||
|
// 'secret' => 'yC3EEMk31oZpas8U65awdT5rxR40+8uP5NEkD82S3iLNNWqr',
|
||||||
|
// 'trusted_domains' => [
|
||||||
|
// 0 => 'dkhost.xai-corp.net:8083',
|
||||||
|
// ],
|
||||||
|
// 'datadirectory' => '/var/www/html/data',
|
||||||
|
// 'overwritehost' => 'xaibox.xai-corp.net',
|
||||||
|
// 'overwriteprotocol' => 'https',
|
||||||
|
// 'overwrite.cli.url' => 'https://xaibox.xai-corp.net',
|
||||||
|
];
|
||||||
7
dockerfiles/services/nextcloud/deploy.sh
Normal file
7
dockerfiles/services/nextcloud/deploy.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
|
||||||
|
export DOCKER_HOST=dkmanager:2376
|
||||||
|
|
||||||
|
docker login -u richard -p $DKREGISTRY_PASS $DKREGISTRY
|
||||||
|
|
||||||
|
docker stack deploy --with-registry-auth --prune -c docker-compose-prod.yml xaibox
|
||||||
17
dockerfiles/services/nextcloud/docker-compose-build.yml
Normal file → Executable file
17
dockerfiles/services/nextcloud/docker-compose-build.yml
Normal file → Executable file
@@ -5,24 +5,17 @@
|
|||||||
# docker-compose build && docker push dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest
|
# docker-compose build && docker push dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest
|
||||||
# DOCKER_HOST=dkhost:2376 docker stack deploy --with-registry-auth -c docker-compose-prod.yml owncloud
|
# DOCKER_HOST=dkhost:2376 docker stack deploy --with-registry-auth -c docker-compose-prod.yml owncloud
|
||||||
|
|
||||||
version: '3'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
|
|
||||||
xaicloud:
|
xaicloud:
|
||||||
image: "dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest"
|
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: ./Dockerfile
|
||||||
ports:
|
image: dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest
|
||||||
- 8083:80
|
|
||||||
# - 9083:9000
|
|
||||||
volumes:
|
|
||||||
- ./data:/var/www/html
|
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: "dkregistry.xai-corp.net:5000/xaicorp/nextcloud-web:latest"
|
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile-web
|
dockerfile: ./Dockerfile-web
|
||||||
ports:
|
image: dkregistry.xai-corp.net:5000/xaicorp/nextcloud-web:latest
|
||||||
- 8083:80
|
|
||||||
|
|||||||
79
dockerfiles/services/nextcloud/docker-compose-prod.yml
Normal file → Executable file
79
dockerfiles/services/nextcloud/docker-compose-prod.yml
Normal file → Executable file
@@ -11,12 +11,25 @@ volumes:
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
xaicloud:
|
app:
|
||||||
image: "dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest"
|
image: "dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest"
|
||||||
|
# ports:
|
||||||
|
# - 8083:80
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/shared/nextcloud/data:/var/www/html/data
|
# - code:/var/www/html
|
||||||
- /opt/shared/nextcloud/config:/var/www/html/config
|
- /opt/nextcloud/nextcloud2/data:/var/www/html/data
|
||||||
- /opt/shared/nextcloud/apps:/var/www/html/custom_apps
|
- /opt/nextcloud/nextcloud2/config:/var/www/html/config
|
||||||
|
- /opt/nextcloud/nextcloud2/apps:/var/www/html/custom_apps
|
||||||
|
environment:
|
||||||
|
- DBTYPE=mysql
|
||||||
|
- DBHOST=sql.xai-corp.net
|
||||||
|
- DBPORT=3306
|
||||||
|
- DBNAME=nextcloud2
|
||||||
|
- DBUSER=nextcloud
|
||||||
|
- DBPASS=xh891hx1hc89f239hibndnxc1i
|
||||||
|
- REDISHOST=tasks.services_redis
|
||||||
|
- REDISPORT=6379
|
||||||
|
- LOGLEVEL=3
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
replicas: 1
|
replicas: 1
|
||||||
@@ -31,8 +44,11 @@ services:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 512M
|
memory: 512M
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
- prod
|
- prod_app
|
||||||
|
- prod_db
|
||||||
|
- prod_cache
|
||||||
|
|
||||||
# logging:
|
# logging:
|
||||||
# driver: fluentd
|
# driver: fluentd
|
||||||
@@ -40,6 +56,7 @@ services:
|
|||||||
# fluentd-address: "logs.xai-corp.net:24224"
|
# fluentd-address: "logs.xai-corp.net:24224"
|
||||||
# fluentd-async-connect: 'true'
|
# fluentd-async-connect: 'true'
|
||||||
# tag: nextcloud
|
# tag: nextcloud
|
||||||
|
#
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: "dkregistry.xai-corp.net:5000/xaicorp/nextcloud-web:latest"
|
image: "dkregistry.xai-corp.net:5000/xaicorp/nextcloud-web:latest"
|
||||||
@@ -47,9 +64,10 @@ services:
|
|||||||
- 8083:80
|
- 8083:80
|
||||||
volumes:
|
volumes:
|
||||||
- cache:/data/nginx/cache/nextcloud
|
- cache:/data/nginx/cache/nextcloud
|
||||||
- /opt/shared/nextcloud/data:/var/www/html/data
|
# - code:/var/www/html
|
||||||
- /opt/shared/nextcloud/config:/var/www/html/config
|
- /opt/nextcloud/nextcloud2/data:/var/www/html/data
|
||||||
- /opt/shared/nextcloud/apps:/var/www/html/custom_apps
|
- /opt/nextcloud/nextcloud2/config:/var/www/html/config
|
||||||
|
- /opt/nextcloud/nextcloud2/apps:/var/www/html/custom_apps
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -72,42 +90,19 @@ services:
|
|||||||
# timeout: 1s
|
# timeout: 1s
|
||||||
# retries: 2
|
# retries: 2
|
||||||
networks:
|
networks:
|
||||||
- ingress
|
- prod_ui
|
||||||
- prod
|
- prod_app
|
||||||
|
|
||||||
# collabora:
|
|
||||||
# image: collabora/code
|
|
||||||
# ports:
|
|
||||||
# - 9980:9980
|
|
||||||
# environment:
|
|
||||||
# domain: office\\.xai-corp\\.net
|
|
||||||
# username: admin
|
|
||||||
# password: ah8031qhnbc
|
|
||||||
# server_name: office.xai-corp.net
|
|
||||||
#
|
|
||||||
# deploy:
|
|
||||||
# mode: replicated
|
|
||||||
# replicas: 0
|
|
||||||
# restart_policy:
|
|
||||||
# condition: any
|
|
||||||
# delay: "1s"
|
|
||||||
# max_attempts: 5
|
|
||||||
# update_config:
|
|
||||||
# parallelism: 1
|
|
||||||
# delay: 2s
|
|
||||||
# order: start-first
|
|
||||||
# resources:
|
|
||||||
# limits:
|
|
||||||
# cpus: '1'
|
|
||||||
# memory: 512M
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
prod_ui:
|
||||||
external:
|
external:
|
||||||
name: ingress
|
name: prod_ui
|
||||||
ingress:
|
prod_db:
|
||||||
external:
|
external:
|
||||||
name: ingress
|
name: prod_db
|
||||||
prod:
|
prod_cache:
|
||||||
external:
|
external:
|
||||||
name: prod
|
name: prod_cache
|
||||||
|
prod_app:
|
||||||
|
external:
|
||||||
|
name: prod_app
|
||||||
|
|||||||
44
dockerfiles/services/nextcloud/docker-compose.yml
Normal file → Executable file
44
dockerfiles/services/nextcloud/docker-compose.yml
Normal file → Executable file
@@ -5,10 +5,10 @@
|
|||||||
# docker-compose build && docker push dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest
|
# docker-compose build && docker push dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest
|
||||||
# DOCKER_HOST=dkhost:2376 docker stack deploy --with-registry-auth -c docker-compose-prod.yml owncloud
|
# DOCKER_HOST=dkhost:2376 docker stack deploy --with-registry-auth -c docker-compose-prod.yml owncloud
|
||||||
|
|
||||||
version: '2'
|
version: '3'
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
nextcloud:
|
# nextcloud:
|
||||||
db:
|
db:
|
||||||
cache:
|
cache:
|
||||||
|
|
||||||
@@ -25,21 +25,41 @@ services:
|
|||||||
- MYSQL_USER=nextcloud
|
- MYSQL_USER=nextcloud
|
||||||
|
|
||||||
xaicloud:
|
xaicloud:
|
||||||
image: nextcloud:fpm
|
image: dkregistry.xai-corp.net:5000/xaicorp/nextcloud:latest
|
||||||
links:
|
|
||||||
- db
|
|
||||||
volumes:
|
volumes:
|
||||||
- nextcloud:/var/www/html
|
# - nextcloud:/var/www/html
|
||||||
|
- ./config:/var/www/html/config
|
||||||
|
- ./php/errorlog.conf:/usr/local/etc/php-fpm.d/errorlog.conf
|
||||||
|
environment:
|
||||||
|
- DBTYPE=mysql
|
||||||
|
- DBHOST=db
|
||||||
|
- DBPORT=3306
|
||||||
|
- DBNAME=nextcloud
|
||||||
|
- DBUSER=nextcloud
|
||||||
|
- DBPASS=test
|
||||||
|
- REDISHOST=redis
|
||||||
|
- REDISPORT=6379
|
||||||
|
- LOGLEVEL=3
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: nginx
|
image: dkregistry.xai-corp.net:5000/xaicorp/nextcloud-web:latest
|
||||||
ports:
|
ports:
|
||||||
- 8083:80
|
- 8083:80
|
||||||
links:
|
|
||||||
- app
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
||||||
- cache:/data/nginx/cache/nextcloud
|
- cache:/data/nginx/cache/nextcloud
|
||||||
volumes_from:
|
# - nextcloud:/var/www/html
|
||||||
- app
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
|
- ./config:/var/www/html/config
|
||||||
|
|
||||||
|
memcached:
|
||||||
|
image: "memcached:alpine"
|
||||||
|
ports:
|
||||||
|
- "11211:11211"
|
||||||
|
command:
|
||||||
|
- memcached
|
||||||
|
- -m64
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: "redis:4-alpine"
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
proxy_cache_path /data/nginx/cache/nextcloud levels=1:2 keys_zone=my_cache:10m max_size=10g
|
proxy_cache_path /data/nginx/cache/nextcloud levels=1:2 keys_zone=my_cache:10m max_size=10g
|
||||||
inactive=60m use_temp_path=off;
|
inactive=60m use_temp_path=off;
|
||||||
|
|
||||||
|
|
||||||
|
upstream xaibox_upstream {
|
||||||
|
server tasks.xaibox_app:9000;
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
server_name docker.test;
|
server_name xaibox.xai-corp.net;
|
||||||
|
|
||||||
|
client_max_body_size 256m;
|
||||||
|
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
|
|
||||||
location /remote.php {
|
location /remote.php {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass tasks.xaicloud:9000;
|
fastcgi_pass xaibox_upstream;
|
||||||
fastcgi_index remote.php;
|
fastcgi_index remote.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
@@ -18,18 +25,51 @@ server {
|
|||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location /public.php {
|
||||||
try_files $uri /index.php?$args;
|
|
||||||
}
|
|
||||||
|
|
||||||
# location / {
|
|
||||||
location ~ \.php$ {
|
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass tasks.xaicloud:9000;
|
fastcgi_pass xaibox_upstream;
|
||||||
fastcgi_index index.php;
|
fastcgi_index public.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
# fastcgi_param SCRIPT_FILENAME $document_root/index.php;
|
# fastcgi_param SCRIPT_FILENAME $document_root/index.php;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass xaibox_upstream;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /index.php {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass xaibox_upstream;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ [^/]\.php(/|$) {
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
if (!-f $document_root$fastcgi_script_name) {
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
fastcgi_param HTTP_PROXY "";
|
||||||
|
|
||||||
|
fastcgi_pass xaibox_upstream;
|
||||||
|
#fastcgi_index public.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
#fastcgi_param SCRIPT_FILENAME $document_root/index.php;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
#location / {
|
||||||
|
# try_files $uri $uri/;
|
||||||
|
#}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
dockerfiles/services/nextcloud/php/errorlog.conf
Executable file
2
dockerfiles/services/nextcloud/php/errorlog.conf
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
[www]
|
||||||
|
catch_workers_output = yes
|
||||||
@@ -39,7 +39,6 @@ services:
|
|||||||
# cpus: '1'
|
# cpus: '1'
|
||||||
memory: 512M
|
memory: 512M
|
||||||
networks:
|
networks:
|
||||||
- ingress
|
|
||||||
- prod
|
- prod
|
||||||
|
|
||||||
graphana:
|
graphana:
|
||||||
@@ -50,8 +49,6 @@ services:
|
|||||||
GF_SECURITY_ADMIN_PASSWORD: sakas
|
GF_SECURITY_ADMIN_PASSWORD: sakas
|
||||||
# volumes:
|
# volumes:
|
||||||
# - /opt/shared/nextcloud/data:/var/www/html/data
|
# - /opt/shared/nextcloud/data:/var/www/html/data
|
||||||
networks:
|
|
||||||
- ingress
|
|
||||||
|
|
||||||
postgres_exported:
|
postgres_exported:
|
||||||
image: wrouesnel/postgres_exporter
|
image: wrouesnel/postgres_exporter
|
||||||
@@ -103,12 +100,6 @@ services:
|
|||||||
- prod
|
- prod
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
ingress:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
prod:
|
prod:
|
||||||
external:
|
external:
|
||||||
name: prod
|
name: prod
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ services:
|
|||||||
API_KEY: ca0faf176c4aedd4f547ed7cf85615eb
|
API_KEY: ca0faf176c4aedd4f547ed7cf85615eb
|
||||||
LOG_LEVEL: INFO
|
LOG_LEVEL: INFO
|
||||||
NON_LOCAL_TRAFFIC: "true"
|
NON_LOCAL_TRAFFIC: "true"
|
||||||
# ports:
|
ports:
|
||||||
# - "8125:8125/udp"
|
- "8125:8125/udp"
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
replicas: 1
|
replicas: 1
|
||||||
@@ -32,14 +32,3 @@ services:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: 512M
|
memory: 512M
|
||||||
|
|
||||||
networks:
|
|
||||||
default:
|
|
||||||
external:
|
|
||||||
name: prod
|
|
||||||
ingress:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
prod:
|
|
||||||
external:
|
|
||||||
name: prod
|
|
||||||
|
|||||||
18
dockerfiles/services/services/deploy_networks.sh
Executable file
18
dockerfiles/services/services/deploy_networks.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
|
||||||
|
export DOCKER_HOST=dkmanager:2376
|
||||||
|
|
||||||
|
NETWORK=prod
|
||||||
|
docker network inspect $NETWORK > /dev/null || docker network create -d overlay $NETWORK
|
||||||
|
|
||||||
|
NETWORK=prod_ui
|
||||||
|
docker network inspect $NETWORK > /dev/null || docker network create -d overlay $NETWORK
|
||||||
|
|
||||||
|
NETWORK=prod_db
|
||||||
|
docker network inspect $NETWORK > /dev/null || docker network create -d overlay $NETWORK
|
||||||
|
|
||||||
|
NETWORK=prod_app
|
||||||
|
docker network inspect $NETWORK > /dev/null || docker network create -d overlay $NETWORK
|
||||||
|
|
||||||
|
NETWORK=prod_cache
|
||||||
|
docker network inspect $NETWORK > /dev/null || docker network create -d overlay $NETWORK
|
||||||
@@ -51,17 +51,3 @@ services:
|
|||||||
fluentd-address: "logs.xai-corp.net:24224"
|
fluentd-address: "logs.xai-corp.net:24224"
|
||||||
fluentd-async-connect: 'true'
|
fluentd-async-connect: 'true'
|
||||||
tag: dkregistry
|
tag: dkregistry
|
||||||
|
|
||||||
networks:
|
|
||||||
- ingress
|
|
||||||
|
|
||||||
networks:
|
|
||||||
default:
|
|
||||||
external:
|
|
||||||
name: prod
|
|
||||||
ingress:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
prod:
|
|
||||||
external:
|
|
||||||
name: prod
|
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ services:
|
|||||||
- "24224:24224"
|
- "24224:24224"
|
||||||
- "24224:24224/udp"
|
- "24224:24224/udp"
|
||||||
- 24220:24220
|
- 24220:24220
|
||||||
expose:
|
|
||||||
- "24220"
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -37,18 +35,3 @@ services:
|
|||||||
limits:
|
limits:
|
||||||
cpus: '1'
|
cpus: '1'
|
||||||
memory: 64M
|
memory: 64M
|
||||||
|
|
||||||
networks:
|
|
||||||
- ingress
|
|
||||||
- prod
|
|
||||||
|
|
||||||
networks:
|
|
||||||
default:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
ingress:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
prod:
|
|
||||||
external:
|
|
||||||
name: prod
|
|
||||||
|
|||||||
@@ -6,23 +6,24 @@ CONFIG=stack.tmp.yml
|
|||||||
SERVICE=services
|
SERVICE=services
|
||||||
#NETWORK=prod
|
#NETWORK=prod
|
||||||
|
|
||||||
docker stack deploy --with-registry-auth -c dkregistry/docker-compose.yml $SERVICE
|
docker stack deploy -c dkregistry/docker-compose.yml $SERVICE
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
|
||||||
docker login -u richard -p $DKREGISTRY_PASS $DKREGISTRY
|
docker login -u richard -p $DKREGISTRY_PASS $DKREGISTRY
|
||||||
|
|
||||||
docker network inspect $NETWORK > /dev/null || docker network create -d overlay $NETWORK
|
|
||||||
|
|
||||||
docker-compose \
|
docker-compose \
|
||||||
-f network.yml \
|
-f network.yml \
|
||||||
-f dkregistry/docker-compose.yml \
|
|
||||||
-f fluentd/docker-compose-prod.yml \
|
|
||||||
-f mariadb/docker-compose.yml \
|
|
||||||
-f postgres/docker-compose.yml \
|
-f postgres/docker-compose.yml \
|
||||||
|
-f dkregistry/docker-compose.yml \
|
||||||
|
-f mariadb/docker-compose.yml \
|
||||||
|
-f fluentd/docker-compose-prod.yml \
|
||||||
-f memcached/docker-compose.yml \
|
-f memcached/docker-compose.yml \
|
||||||
-f redis/docker-compose.yml \
|
-f redis/docker-compose.yml \
|
||||||
-f datadog/docker-compose.yml \
|
-f datadog/docker-compose.yml \
|
||||||
config > $CONFIG
|
config > $CONFIG
|
||||||
|
|
||||||
|
|
||||||
docker stack deploy --prune --with-registry-auth -c $CONFIG $SERVICE
|
docker stack deploy --prune --with-registry-auth -c $CONFIG $SERVICE
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ services:
|
|||||||
mysql:
|
mysql:
|
||||||
image: "mariadb:10"
|
image: "mariadb:10"
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/shared/mariadb/data:/var/lib/mysql
|
- /opt/mariadb/data:/var/lib/mysql
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
environment:
|
environment:
|
||||||
@@ -39,5 +39,4 @@ services:
|
|||||||
tag: mariadb
|
tag: mariadb
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
- prod
|
- prod_db
|
||||||
- ingress
|
|
||||||
|
|||||||
@@ -38,4 +38,4 @@ services:
|
|||||||
memory: 65M
|
memory: 65M
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
- prod
|
- prod_cache
|
||||||
|
|||||||
@@ -4,12 +4,18 @@
|
|||||||
version: '3.4'
|
version: '3.4'
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
|
||||||
external:
|
|
||||||
name: prod
|
|
||||||
ingress:
|
|
||||||
external:
|
|
||||||
name: ingress
|
|
||||||
prod:
|
prod:
|
||||||
external:
|
external:
|
||||||
name: prod
|
name: prod
|
||||||
|
prod_ui:
|
||||||
|
external:
|
||||||
|
name: prod_ui
|
||||||
|
prod_db:
|
||||||
|
external:
|
||||||
|
name: prod_db
|
||||||
|
prod_cache:
|
||||||
|
external:
|
||||||
|
name: prod_cache
|
||||||
|
prod_app:
|
||||||
|
external:
|
||||||
|
name: prod_app
|
||||||
|
|||||||
@@ -39,4 +39,4 @@ services:
|
|||||||
memory: 128M
|
memory: 128M
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
- prod
|
- prod_db
|
||||||
|
|||||||
@@ -34,4 +34,4 @@ services:
|
|||||||
tag: redis
|
tag: redis
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
- prod
|
- prod_cache
|
||||||
|
|||||||
7
dockerfiles/services/sslproxy/build.sh
Normal file
7
dockerfiles/services/sslproxy/build.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
|
||||||
|
docker login -u richard -p $DKREGISTRY_PASS http://$DKREGISTRY
|
||||||
|
|
||||||
|
(docker-compose -f docker-compose.yml build)
|
||||||
|
|
||||||
|
docker push dkregistry.xai-corp.net:5000/sslproxy:2.1
|
||||||
7
dockerfiles/services/sslproxy/deploy.sh
Normal file
7
dockerfiles/services/sslproxy/deploy.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
|
||||||
|
export DOCKER_HOST=dkmanager:2376
|
||||||
|
|
||||||
|
docker login -u richard -p $DKREGISTRY_PASS $DKREGISTRY
|
||||||
|
|
||||||
|
docker stack deploy --with-registry-auth --prune -c docker-compose-prod.yml sslproxy
|
||||||
@@ -6,27 +6,25 @@
|
|||||||
# DOCKER_HOST=dkhost:2376 docker stack ps sslproxy
|
# DOCKER_HOST=dkhost:2376 docker stack ps sslproxy
|
||||||
|
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
|
volumes:
|
||||||
|
cache:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: "dkregistry.xai-corp.net:5000/sslproxy:2.1"
|
image: "dkregistry.xai-corp.net:5000/sslproxy:2.1"
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/shared/letsencrypt-2:/etc/letsencrypt:ro
|
- /opt/shared/letsencrypt-2:/etc/letsencrypt:ro
|
||||||
|
- cache:/data/nginx/cache
|
||||||
ports:
|
ports:
|
||||||
- "443:443"
|
- "443:443"
|
||||||
- "80:80" # required for letsencrypt
|
- "80:80" # required for letsencrypt
|
||||||
|
#
|
||||||
# logging:
|
# logging:
|
||||||
# driver: syslog
|
# driver: fluentd
|
||||||
# options:
|
# options:
|
||||||
# syslog-address: "tcp+tls://logs6.papertrailapp.com:38577"
|
# fluentd-address: "logs.xai-corp.net:24224"
|
||||||
# tag: "{{.Name}}/{{.ID}}"
|
# fluentd-async-connect: 'true'
|
||||||
|
# tag: sslproxy
|
||||||
logging:
|
|
||||||
driver: fluentd
|
|
||||||
options:
|
|
||||||
fluentd-address: "logs.xai-corp.net:24224"
|
|
||||||
fluentd-async-connect: 'true'
|
|
||||||
tag: sslproxy
|
|
||||||
|
|
||||||
# logging:
|
# logging:
|
||||||
# driver: syslog
|
# driver: syslog
|
||||||
@@ -34,8 +32,16 @@ services:
|
|||||||
# syslog-address: "udp://logs.xai-corp.net:31514"
|
# syslog-address: "udp://logs.xai-corp.net:31514"
|
||||||
# tag: sslproxy
|
# tag: sslproxy
|
||||||
|
|
||||||
|
# logging:
|
||||||
|
# driver: syslog
|
||||||
|
# options:
|
||||||
|
# syslog-address: "tcp+tls://logs6.papertrailapp.com:38577"
|
||||||
|
# tag: "{{.Name}}/{{.ID}}"
|
||||||
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
mode: global
|
mode: replicated
|
||||||
|
replicas: 1
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: any
|
condition: any
|
||||||
delay: 6s
|
delay: 6s
|
||||||
@@ -52,6 +58,14 @@ services:
|
|||||||
labels:
|
labels:
|
||||||
net.xai-corp.sslproxy.description: proxy ssl calls to non ssl containers
|
net.xai-corp.sslproxy.description: proxy ssl calls to non ssl containers
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- prod_ui
|
||||||
|
|
||||||
|
networks:
|
||||||
|
prod_ui:
|
||||||
|
external:
|
||||||
|
name: prod_ui
|
||||||
|
|
||||||
# networks:
|
# networks:
|
||||||
# - ingress
|
# - ingress
|
||||||
# - prod
|
# - prod
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
|
proxy_cache_path /data/nginx/cache/dkui levels=1:2 keys_zone=dkui:10m max_size=10g
|
||||||
|
inactive=60m use_temp_path=off;
|
||||||
|
|
||||||
|
upstream portainer_upstream {
|
||||||
|
server tasks.dkui_app:9000;
|
||||||
|
|
||||||
|
server dkhost.xai-corp.net:9000 backup;
|
||||||
|
}
|
||||||
|
|
||||||
# dkui.xai-corp.net
|
# dkui.xai-corp.net
|
||||||
server {
|
server {
|
||||||
listen 443 ssl ipv6only=off;
|
# listen 443 ssl ipv6only=off;
|
||||||
|
listen 443 ssl;
|
||||||
server_name dkui.xai-corp.net;
|
server_name dkui.xai-corp.net;
|
||||||
ssl_certificate /etc/letsencrypt/live/xai-corp.net/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/xai-corp.net/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/xai-corp.net/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/xai-corp.net/privkey.pem;
|
||||||
@@ -15,7 +25,10 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Host $host;
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_pass http://dkhost.xai-corp.net:9000;
|
proxy_pass http://portainer_upstream;
|
||||||
|
|
||||||
|
proxy_connect_timeout 3s;
|
||||||
|
# proxy_next_upstream_timeout 1.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
proxy_cache_path /data/nginx/cache/gitea levels=1:2 keys_zone=gitea:10m max_size=10g
|
||||||
|
inactive=60m use_temp_path=off;
|
||||||
|
|
||||||
|
upstream gitea_upstream {
|
||||||
|
server tasks.gitea_app:10080;
|
||||||
|
|
||||||
|
server dkhost.xai-corp.net:10080 backup;
|
||||||
|
}
|
||||||
|
|
||||||
# git.xai-corp.net
|
# git.xai-corp.net
|
||||||
server {
|
server {
|
||||||
listen 443 ssl ipv6only=off;
|
listen 443 ssl ipv6only=off;
|
||||||
@@ -9,7 +18,6 @@ server {
|
|||||||
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always;
|
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains" always;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://dkhost.xai-corp.net:10080;
|
proxy_pass http://gitea_upstream;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
|
proxy_cache_path /data/nginx/cache/xaibox levels=1:2 keys_zone=xaibox:10m max_size=10g
|
||||||
|
inactive=60m use_temp_path=off;
|
||||||
|
|
||||||
|
upstream xaibox_upstream {
|
||||||
|
server tasks.xaibox_web:8083;
|
||||||
|
|
||||||
|
server xaibox.xai-corp.net:8083 backup;
|
||||||
|
server dkhost.xai-corp.net:8083 backup;
|
||||||
|
}
|
||||||
|
|
||||||
# xaibox.xai-corp.net
|
# xaibox.xai-corp.net
|
||||||
server {
|
server {
|
||||||
listen 443 ssl ipv6only=off;
|
listen 443 ssl;
|
||||||
server_name xaibox.xai-corp.net;
|
server_name xaibox.xai-corp.net;
|
||||||
ssl_certificate /etc/letsencrypt/live/xai-corp.net/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/xai-corp.net/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/xai-corp.net/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/xai-corp.net/privkey.pem;
|
||||||
@@ -12,7 +22,7 @@ server {
|
|||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_set_header Connection $http_connection;
|
proxy_set_header Connection $http_connection;
|
||||||
proxy_pass http://dkhost.xai-corp.net:8083;
|
proxy_pass http://xaibox_upstream;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
# DOCKER_HOST=192.168.2.41:2376 docker-compose up -d
|
# DOCKER_HOST=192.168.2.41:2376 docker-compose up -d
|
||||||
# DOCKER_HOST=dkhost:2376 docker stack deploy -c docker-compose.yml dkui
|
# DOCKER_HOST=dkmanager:2376 docker stack deploy -c docker-compose.yml dkui
|
||||||
|
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
services:
|
services:
|
||||||
@@ -10,11 +10,14 @@ services:
|
|||||||
image: "portainer/portainer"
|
image: "portainer/portainer"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
# - /var/run/docker.sock:/var/run/docker.sock
|
||||||
- /opt/shared/portainer/data:/data
|
- /opt/shared/portainer/data:/data
|
||||||
ports:
|
ports:
|
||||||
# - "80:80"
|
# - "80:80"
|
||||||
- "9000:9000"
|
- "9000:9000"
|
||||||
|
command:
|
||||||
|
- "-H"
|
||||||
|
- "tcp://dkmanager:2376"
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
@@ -22,7 +25,7 @@ services:
|
|||||||
restart_policy:
|
restart_policy:
|
||||||
condition: any
|
condition: any
|
||||||
delay: 5s
|
delay: 5s
|
||||||
max_attempts: 10
|
max_attempts: 1
|
||||||
update_config:
|
update_config:
|
||||||
parallelism: 1
|
parallelism: 1
|
||||||
delay: 2s
|
delay: 2s
|
||||||
@@ -31,8 +34,8 @@ services:
|
|||||||
net.xai-corp.dkui.description: portainer ui for docker host and swarm management
|
net.xai-corp.dkui.description: portainer ui for docker host and swarm management
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: '0.2'
|
# cpus: '0.2'
|
||||||
memory: 16M
|
memory: 32M
|
||||||
|
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
@@ -42,13 +45,16 @@ services:
|
|||||||
fluentd-async-connect: 'true'
|
fluentd-async-connect: 'true'
|
||||||
tag: dkui
|
tag: dkui
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- prod_ui
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
prod_ui:
|
||||||
external:
|
external:
|
||||||
name: ingress
|
name: prod_ui
|
||||||
ingress:
|
prod_db:
|
||||||
external:
|
external:
|
||||||
name: ingress
|
name: prod_db
|
||||||
prod:
|
prod_cache:
|
||||||
external:
|
external:
|
||||||
name: prod
|
name: prod_cache
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
- /data/glusterfs/jenkins2/brick1
|
- /data/glusterfs/jenkins2/brick1
|
||||||
- /data/glusterfs/tmp/brick1
|
- /data/glusterfs/tmp/brick1
|
||||||
- /data/glusterfs/prometheus/brick1
|
- /data/glusterfs/prometheus/brick1
|
||||||
# - /data/glusterfs/elasticsearch/brick1
|
- /data/glusterfs/nextcloud/brick1
|
||||||
|
- /data/glusterfs/mariadb/brick1
|
||||||
|
- /data/glusterfs/postgresql/brick1
|
||||||
volumes:
|
volumes:
|
||||||
gitea:
|
gitea:
|
||||||
- /data/glusterfs/gitea/brick1/brick
|
- /data/glusterfs/gitea/brick1/brick
|
||||||
@@ -26,6 +28,12 @@
|
|||||||
- /data/glusterfs/jenkins2/brick1/brick
|
- /data/glusterfs/jenkins2/brick1/brick
|
||||||
vmshares:
|
vmshares:
|
||||||
- /data/glusterfs/vmshares/brick1/brick
|
- /data/glusterfs/vmshares/brick1/brick
|
||||||
|
mariadb:
|
||||||
|
- /data/glusterfs/mariadb/brick1/brick
|
||||||
|
postgresql:
|
||||||
|
- /data/glusterfs/postgresql/brick1/brick
|
||||||
|
nextcloud:
|
||||||
|
- /data/glusterfs/nextcloud/brick1/brick
|
||||||
distributed_volumes:
|
distributed_volumes:
|
||||||
tmp:
|
tmp:
|
||||||
- /data/glusterfs/tmp/brick1/brick
|
- /data/glusterfs/tmp/brick1/brick
|
||||||
|
|||||||
31
roles/dockerhost/tasks/glusterfs-volume-driver.yml
Normal file
31
roles/dockerhost/tasks/glusterfs-volume-driver.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
# install glusterfs volume driver plugin
|
||||||
|
|
||||||
|
- name: install golang packages
|
||||||
|
apt:
|
||||||
|
state: installed
|
||||||
|
package: "{{ item }}"
|
||||||
|
update_cache: yes
|
||||||
|
cache_valid_time: 3600
|
||||||
|
with_items:
|
||||||
|
- "golang-go"
|
||||||
|
|
||||||
|
|
||||||
|
- name: make golang workspace
|
||||||
|
file:
|
||||||
|
path: /opt/golang
|
||||||
|
state: directory
|
||||||
|
mode: 0775
|
||||||
|
|
||||||
|
- name: fetch go package
|
||||||
|
shell: GOPATH=/opt/golang go get github.com/amarkwalder/docker-volume-glusterfs
|
||||||
|
|
||||||
|
- name: add plugin to startup
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/rc.local
|
||||||
|
regexp: 'docker-volume-glusterfs -servers'
|
||||||
|
line: '/opt/golang/bin/docker-volume-glusterfs -servers cubox-i:home &'
|
||||||
|
insertbefore: "^exit 0"
|
||||||
|
|
||||||
|
|
||||||
|
#sudo docker-volume-glusterfs -servers gfs-1:gfs-2:gfs-3
|
||||||
@@ -19,7 +19,9 @@
|
|||||||
- name: setup owncloud cron job
|
- name: setup owncloud cron job
|
||||||
cron:
|
cron:
|
||||||
name: owncloud
|
name: owncloud
|
||||||
state: present
|
state: absent
|
||||||
user: www-data
|
user: www-data
|
||||||
day: "*/15"
|
day: "*/15"
|
||||||
job: "curl -k https://xaibox.xai-corp.net/cron.php"
|
job: "curl -k https://xaibox.xai-corp.net/cron.php"
|
||||||
|
|
||||||
|
- include: glusterfs-volume-driver.yml
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ gluster IN A 192.168.2.11
|
|||||||
; docker swarm nodes
|
; docker swarm nodes
|
||||||
dkhost IN A 192.168.2.11
|
dkhost IN A 192.168.2.11
|
||||||
;dkhost IN A 192.168.2.41
|
;dkhost IN A 192.168.2.41
|
||||||
dkhost IN A 192.168.2.52
|
;dkhost IN A 192.168.2.52
|
||||||
;dkhost IN A 192.168.2.53
|
;dkhost IN A 192.168.2.53
|
||||||
dkhost IN A 192.168.2.54
|
;dkhost IN A 192.168.2.54
|
||||||
;dkhost IN A 192.168.2.55
|
;dkhost IN A 192.168.2.55
|
||||||
|
|
||||||
; docker swarm managers
|
; docker swarm managers
|
||||||
|
|||||||
Reference in New Issue
Block a user