Frontend node: Use netork mode host with dockerhost2

This commit is contained in:
Magnus Andersson 2024-04-24 20:44:41 +02:00
parent b5b3885c30
commit 8d2c481569
Signed by untrusted user: mandersson
GPG key ID: 19CB2C58E1F19B16
4 changed files with 19 additions and 0 deletions

View file

@ -60,6 +60,9 @@ define sunetdrive::app_type (
} else {
$php_memory_limit_mb = 512
}
if $::facts['dockerhost2'] == 'yes' {
$hostnet = 'yes'
}
# These are encrypted values from local.eyaml

View file

@ -25,7 +25,11 @@ $CONFIG = array (
'csrf.disabled' => true,
'datadirectory' => '/var/www/html/data',
'davstorage.request_timeout' => 86401,
<%- if @hostnet -%>
'dbhost' => '127.0.0.1',
<%- else -%>
'dbhost' => '<%= @dbhost %>',
<%- end -%>
'dbname' => '<%= @dbname %>',
'dbpassword' => '<%= @mysql_user_password %>',
'dbport' => '3306',

View file

@ -6,6 +6,9 @@ services:
image: docker.sunet.se/drive/nextcloud-custom:<%= @nextcloud_version %>
restart: always
container_name: nextcloud_app_1
<%- if @hostnet -%>
network_mode: host
<%- end -%>
environment:
- NC_PASS=<%= @admin_password%>
volumes:
@ -28,9 +31,11 @@ services:
<% if @location =~ /^kau/ -%>
- /mnt:/opt/tmp/
<%- end -%>
<%- if ! @hostnet -%>
networks:
- default
- proxysql_proxysql
<%- end -%>
dns:
- 89.46.20.75
- 89.46.21.29

View file

@ -5,6 +5,9 @@ services:
proxysql:
image: docker.sunet.se/drive/proxysql:<%= @proxysql_version %>
container_name: proxysql_proxysql_1
<%- if @hostnet -%>
network_mode: host
<%- end -%>
ports:
- 3306:3306
- 6032:6032
@ -15,8 +18,10 @@ services:
- 89.46.20.75
- 89.46.21.29
- 89.32.32.32
<%- if ! @hostnet -%>
networks:
- proxysql
<%- end -%>
restart: unless-stopped
volumes:
- proxysql:/var/lib/proxysql
@ -26,6 +31,8 @@ services:
volumes:
proxysql:
<%- if @hostnet -%>
networks:
proxysql:
driver: bridge
<%- end -%>