Skip to content

Commit

Permalink
portainer: add http port (#1355)
Browse files Browse the repository at this point in the history
* portainer: add http port

* split

* cleaner

* fmt

* bump
  • Loading branch information
stavros-k authored Jan 14, 2025
1 parent 16d449d commit 4f37dc7
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ix-dev/community/portainer/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ sources:
- https://github.com/portainer/portainer
title: Portainer
train: community
version: 1.3.10
version: 1.3.11
33 changes: 33 additions & 0 deletions ix-dev/community/portainer/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,39 @@ questions:
show_if: [["tunnel_enabled", "=", true]]
$ref:
- definitions/port
- variable: http_port
label: HTTP Port (Optional)
schema:
type: dict
attrs:
- variable: bind_mode
label: Port Bind Mode
description: |
The port bind mode.</br>
- Publish: The port will be published on the host for external access.</br>
- Expose: The port will be exposed for inter-container communication.</br>
- None: The port will not be exposed or published.</br>
Note: If the Dockerfile defines an EXPOSE directive,
the port will still be exposed for inter-container communication regardless of this setting.
schema:
type: string
default: ""
enum:
- value: "published"
description: Publish port on the host for external access
- value: "exposed"
description: Expose port for inter-container communication
- value: ""
description: None
- variable: port_number
label: Port Number
schema:
type: int
show_if: [["bind_mode", "!=", ""]]
default: 31017
required: true
$ref:
- definitions/port
- variable: certificate_id
label: Certificate
description: The certificate to use for Portainer.
Expand Down
7 changes: 6 additions & 1 deletion ix-dev/community/portainer/templates/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
"--data", values.consts.data_path,
"--tunnel-port", tpl.funcs.or_default(values.network.tunnel_port, 0),
"--bind-https", ":%d" | format(values.network.web_port),
"--http-disabled",
"--http-enabled" if values.network.http_port.bind_mode == "published" else "--http-disabled",
]) %}

{% if values.network.http_port.bind_mode == "published" %}
{% do cmd.x.extend(["--bind", ":%d" | format(values.network.http_port.port_number)]) %}
{% endif %}

{% if values.network.certificate_id %}
{% do cmd.x.extend([
"--sslkey", values.consts.ssl_key_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ network:
web_port: 8080
tunnel_enabled: false
tunnel_port: 8000
http_port:
bind_mode: ""
port_number: 8081

ix_volumes:
data: /opt/tests/mnt/data
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
resources:
limits:
cpus: 2.0
memory: 4096

portainer:
image_selector: image
additional_envs: []
network:
host_network: false
web_port: 8080
tunnel_enabled: false
tunnel_port: 8000
http_port:
bind_mode: published
port_number: 8081

ix_volumes:
data: /opt/tests/mnt/data

storage:
data:
type: ix_volume
ix_volume_config:
dataset_name: data
create_host_path: true
additional_storage:
- type: anonymous
mount_path: /scratchpad
volume_config:
nocopy: true
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ network:
tunnel_enabled: true
tunnel_port: 8000
certificate_id: "2"
http_port:
bind_mode: ""
port_number: 8081

ix_volumes:
data: /opt/tests/mnt/data
Expand Down

0 comments on commit 4f37dc7

Please sign in to comment.