nextcloud-standalone-docker

Description

TODO: add db support, etc

Resources

Variables

Name Type Default Description

persistent_data

string --

The path to where the container should store its persistent data. Required

user

string --

The local user who should own the nextcloud parent data folder (will also be added to the list of docker users). Required

container_name

string nextcloud

The name for the container image.

ensure_docker_installed

boolean False

Install Docker if not already present.

port

integer 8080

The port where Nextcloud should be available.

Code

doc:
  short_help: Execute the 'nextcloud' docker image.
  help: |
    TODO: add db support, etc
  references:
    "'nextcloud' dockerhub page": https://hub.docker.com/_/nextcloud/

args:
  _import:
  - docker-container-running
  user:
    doc:
      short_help: The local user who should own the nextcloud parent data folder (will
        also be added to the list of docker users).
    type: string
    required: true
  persistent_data:
    doc:
      short_help: The path to where the container should store its persistent data.
    type: string
    required: true
  port:
    doc:
      short_help: The port where Nextcloud should be available.
    type: integer
    required: true
    default: 8080
  container_name:
    doc:
      short_help: The name for the container image.
    type: string
    default: nextcloud
    required: true

frecklets:
- folder-exists:
    path: '{{:: persistent_data ::}}'
    owner: '{{:: user ::}}'
- docker-container-running:
    users:
    - '{{:: user ::}}'
    name: '{{:: container_name ::}}'
    image: nextcloud
    ensure_docker_installed: '{{:: ensure_docker_installed ::}}'
    ports:
    - '{{:: port ::}}:80'
    volumes:
    - '{{:: persistent_data ::}}/nextcloud:/var/www/html'
    - '{{:: persistent_data ::}}/custom_apps:/var/www/html/custom_apps'
    - '{{:: persistent_data ::}}/config:/var/www/html/config'
    - '{{:: persistent_data ::}}/data:/var/www/html/data'
frecklecute --community nextcloud-standalone-docker --help

Usage: frecklecute nextcloud-standalone-docker [OPTIONS]

  TODO: add db support, etc

Options:
  --persistent-data PERSISTENT_DATA
                                  The path to where the container should store
                                  its persistent data.  [required]
  --user USER                     The local user who should own the nextcloud
                                  parent data folder (will also be added to
                                  the list of docker users).  [required]
  --container-name CONTAINER_NAME
                                  The name for the container image.
  --ensure-docker-installed / --no-ensure-docker-installed
                                  Install Docker if not already present.
  --port PORT                     The port where Nextcloud should be
                                  available.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.nextcloud_standalone_docker.NextcloudStandaloneDocker
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class NextcloudStandaloneDocker(AutoPycklet):
    """TODO: add db support, etc

       Args:
         container_name: The name for the container image.
         ensure_docker_installed: Install Docker if not already present.
         persistent_data: The path to where the container should store its persistent data.
         port: The port where Nextcloud should be available.
         user: The local user who should own the nextcloud parent data folder (will also be added to the list of docker users).

    """

    FRECKLET_ID = "nextcloud-standalone-docker"

    container_name: str = None
    ensure_docker_installed: bool = None
    persistent_data: str = None
    port: int = None
    user: str = None


    def __post_init__(self):
        super(NextcloudStandaloneDocker, self).__init__(var_names=["container_name", "ensure_docker_installed", "persistent_data", "port", "user"])


frecklet_class = NextcloudStandaloneDocker
# -*- coding: utf-8 -*-


#
# module path: pycklets.nextcloud_standalone_docker.NextcloudStandaloneDocker
#


from pyckles import AutoPycklet

class NextcloudStandaloneDocker(AutoPycklet):
    """TODO: add db support, etc

       Args:
         container_name: The name for the container image.
         ensure_docker_installed: Install Docker if not already present.
         persistent_data: The path to where the container should store its persistent data.
         port: The port where Nextcloud should be available.
         user: The local user who should own the nextcloud parent data folder (will also be added to the list of docker users).

    """

    FRECKLET_ID = "nextcloud-standalone-docker"

    def __init__(self, container_name="nextcloud", ensure_docker_installed=None, persistent_data=None, port=8080, user=None):

        super(NextcloudStandaloneDocker, self).__init__(var_names=["container_name", "ensure_docker_installed", "persistent_data", "port", "user"])
        self._container_name = container_name
        self._ensure_docker_installed = ensure_docker_installed
        self._persistent_data = persistent_data
        self._port = port
        self._user = user

    @property
    def container_name(self):
        return self._container_name

    @container_name.setter
    def container_name(self, container_name):
        self._container_name = container_name

    @property
    def ensure_docker_installed(self):
        return self._ensure_docker_installed

    @ensure_docker_installed.setter
    def ensure_docker_installed(self, ensure_docker_installed):
        self._ensure_docker_installed = ensure_docker_installed

    @property
    def persistent_data(self):
        return self._persistent_data

    @persistent_data.setter
    def persistent_data(self, persistent_data):
        self._persistent_data = persistent_data

    @property
    def port(self):
        return self._port

    @port.setter
    def port(self, port):
        self._port = port

    @property
    def user(self):
        return self._user

    @user.setter
    def user(self, user):
        self._user = user



frecklet_class = NextcloudStandaloneDocker