Compare commits
5 commits
10b0f30155
...
b4ce0046de
Author | SHA1 | Date | |
---|---|---|---|
Micke Nordin | b4ce0046de | ||
Magnus Andersson | 65abea7daa | ||
Magnus Andersson | f1cac6ce35 | ||
Magnus Andersson | cc6f2c8d7b | ||
Magnus Andersson | 4f6786363b |
38
manifests/jupyter_site.pp
Normal file
38
manifests/jupyter_site.pp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#Class for SUNET-Drive-portal-Server
|
||||
class sunetdrive::jupyter_site (
|
||||
String $site_version = '0.0.1-1'
|
||||
) {
|
||||
|
||||
$domain = 'jupyter.sunet.dev'
|
||||
sunet::docker_compose { 'portal_compose':
|
||||
content => template('sunetdrive/jupyter_site/docker-compose.erb.yaml'),
|
||||
service_name => 'jupyter_site',
|
||||
compose_dir => '/opt/',
|
||||
compose_filename => 'docker-compose.yml',
|
||||
description => 'Web server',
|
||||
}
|
||||
|
||||
exec { 'workaround_docker_compose_dir':
|
||||
command => 'mkdir -p /opt/jupyter_site/nginx',
|
||||
unless => 'test -d /opt/jupyter_site/nginx',
|
||||
}
|
||||
|
||||
$nginx_dirs = ['acme', 'certs', 'conf', 'dhparam', 'html', 'vhost']
|
||||
$nginx_dirs.each | $dir| {
|
||||
file { "/opt/jupyter_site/nginx/${dir}":
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0751',
|
||||
}
|
||||
}
|
||||
sunet::misc::ufw_allow { 'https':
|
||||
from => '0.0.0.0/0',
|
||||
port => 443,
|
||||
}
|
||||
# For acme and redirect
|
||||
sunet::misc::ufw_allow { 'http':
|
||||
from => '0.0.0.0/0',
|
||||
port => 80,
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ services:
|
|||
app:
|
||||
image: docker.sunet.se/drive/nextcloud-custom:<%= @nextcloud_version %>
|
||||
restart: always
|
||||
container_name: nextcloud_app_1
|
||||
environment:
|
||||
- NC_PASS=<%= @admin_password%>
|
||||
volumes:
|
||||
|
|
69
templates/jupyter_site/docker-compose.erb.yaml
Normal file
69
templates/jupyter_site/docker-compose.erb.yaml
Normal file
|
@ -0,0 +1,69 @@
|
|||
version: "3.7"
|
||||
|
||||
services:
|
||||
nginx:
|
||||
image: docker.io/nginxproxy/nginx-proxy:latest
|
||||
container_name: nginx
|
||||
networks:
|
||||
- internal_network
|
||||
- external_network
|
||||
dns:
|
||||
- 89.32.32.32
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
labels:
|
||||
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
|
||||
volumes:
|
||||
- /opt/jupyter_site/nginx/certs:/etc/nginx/certs:ro
|
||||
- /opt/jupyter_site/nginx/conf:/etc/nginx/conf.d
|
||||
- /opt/jupyter_site/nginx/dhparam:/etc/nginx/dhparam
|
||||
- /opt/jupyter_site/nginx/html:/usr/share/nginx/html
|
||||
- /opt/jupyter_site/nginx/vhost:/etc/nginx/vhost.d
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
environment:
|
||||
- ENABLE_IPV6=true
|
||||
restart: unless-stopped
|
||||
|
||||
acme:
|
||||
image: docker.io/nginxproxy/acme-companion:latest
|
||||
container_name: acme
|
||||
networks:
|
||||
- external_network
|
||||
dns:
|
||||
- 89.32.32.32
|
||||
volumes:
|
||||
- /opt/jupyter_site/nginx/acme:/etc/acme.sh
|
||||
- /opt/jupyter_site/nginx/certs:/etc/nginx/certs:rw
|
||||
- /opt/jupyter_site/nginx/conf:/etc/nginx/conf.d
|
||||
- /opt/jupyter_site/nginx/dhparam:/etc/nginx/dhparam
|
||||
- /opt/jupyter_site/nginx/html:/usr/share/nginx/html
|
||||
- /opt/jupyter_site/nginx/vhost:/etc/nginx/vhost.d:rw
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
environment:
|
||||
- NGINX_PROXY_CONTAINER=nginx
|
||||
- DEFAULT_EMAIL=drive@sunet.se
|
||||
depends_on:
|
||||
- nginx
|
||||
restart: unless-stopped
|
||||
|
||||
web:
|
||||
image: docker.sunet.se/drive/jupyter-site:<%= @site_version %>
|
||||
container_name: web
|
||||
restart: always
|
||||
networks:
|
||||
- internal_network
|
||||
ports:
|
||||
- "127.0.0.1:3000:3000"
|
||||
dns:
|
||||
- 89.32.32.32
|
||||
environment:
|
||||
- VIRTUAL_HOST=<%= @domain %>
|
||||
- VIRTUAL_PATH=/
|
||||
- VIRTUAL_PORT=3000
|
||||
- LETSENCRYPT_HOST=<%= @domain %>
|
||||
|
||||
networks:
|
||||
external_network:
|
||||
internal_network:
|
||||
internal: true
|
|
@ -4,6 +4,7 @@ services:
|
|||
|
||||
db:
|
||||
image: docker.sunet.se/drive/mariadb:<%= @mariadb_version %>
|
||||
container_name: mariadb_db_1
|
||||
restart: always
|
||||
volumes:
|
||||
- /etc/mariadb/backups:/backups
|
||||
|
|
|
@ -4,6 +4,7 @@ services:
|
|||
|
||||
mariadb_backup:
|
||||
image: docker.sunet.se/drive/mariadb
|
||||
container_name: mariadb_backup_mariadb_backup_1
|
||||
dns:
|
||||
- 89.46.20.75
|
||||
- 89.46.21.29
|
||||
|
|
|
@ -4,6 +4,7 @@ services:
|
|||
|
||||
proxysql:
|
||||
image: docker.sunet.se/drive/proxysql:<%= @proxysql_version %>
|
||||
container_name: proxysql_proxysql_1
|
||||
ports:
|
||||
- 3306:3306
|
||||
- 6032:6032
|
||||
|
|
Loading…
Reference in a new issue