跳至页脚内容
使用 IRONSECUREDOC

Nextcloud Docker Compose(开发者工具如何工作)

What is Docker?

Docker is a free, open-source framework that automates the deployment and scaling of applications within lightweight containers. It packages application code together with all dependencies, such as libraries, tools, and configurations, within one package and runs uniformly across any environment, be it your developer's laptop, the test server, or the actual production cloud server.

Containers are not the same as traditional virtual machines. Containers share the OS kernel of a host system, thus making it much more efficient and faster to launch.

Essentially, Docker defines an application and its environment through Docker images, which are templates for the creation of containers. Orchestration tools include Docker Compose for multi-container applications, and Docker Hub is the central repository where we share images.

What is Nextcloud?

Nextcloud Docker Compose illustrates how to use Docker containers to provide an isolated, portable, and scalable environment for the self-hosted cloud storage application Nextcloud. This popular solution supports file storage and sharing, calendars, contacts, and more, while allowing full control over data.

It simplifies the setup because dependencies like PHP and the web server are contained within one container; Docker makes installing and managing Nextcloud much easier. This also guarantees that everything runs identically across different environments, allowing smooth deployments onto different systems.

Running Nextcloud in Docker is easy, modular, and scalable. For example, in a multi-container setup using Docker Compose, you run separate containers for the Nextcloud database (e.g., MySQL or MariaDB), caching (e.g., Redis), and the Nextcloud application itself. This adds flexibility, allowing for easier management and scalability of Nextcloud instances.

Features of Nextcloud

Nextcloud Docker offers ease of deployment and management features with all the major key features listed below:

  • Simplified Setup: Easy installation due to Docker's ability to carry all dependencies, such as PHP and web servers, within a single container, facilitating hassle-free installation and configuration.
  • Portability: Docker containers are portable across different environments and nodes, preventing compatibility issues when moving your Nextcloud instance between servers or cloud environments.
  • Isolation: Containers are insulated from the host system and other containers, ensuring dependencies and configurations do not clash with other services on the same machine.
  • Scalability: Utilizing Docker Compose, you can easily scale Nextcloud by deploying additional containers for databases, caching, or load balancing services to achieve superior performance in large-scale environments.
  • Persistent Storage: By mounting storage volumes externally to the container, data persists even after container restarts or upgrades.
  • Easy Upgrades: Seamlessly upgrade Nextcloud or its dependencies via Docker by pulling a fresh image version and restarting the container; no confusing migrations are necessary.
  • Security: Docker's inherent isolation minimizes the attack surface by separating Nextcloud's environment from its host and other applications.

All these features make Nextcloud Docker an efficient solution for hosting your private cloud infrastructure.

Install Nextcloud

Prerequisites

  • Windows 10/11 (Pro, Enterprise, or Education) with WSL 2 support.
  • Docker Desktop is installed and running on Windows.
  • Basic familiarity with using a terminal or command prompt.

Pull the Nextcloud Docker Image

Pull the official Nextcloud Docker image from Docker Hub by running the following command in your terminal:

docker pull nextcloud
docker pull nextcloud
SHELL

Alternatively, open the Docker application and search for "nextcloud" in the search box.

To run the Nextcloud installation, use the command below in the command prompt:

docker run -d -p 8080:80 nextcloud
docker run -d -p 8080:80 nextcloud
SHELL

This command will download the Nextcloud image and create a new container, exposing it on port 8080.

Setup MariaDB for the Database

Nextcloud requires a database to store its data. We can use MariaDB as a drop-in replacement for MySQL.

First, pull the MariaDB image:

docker pull mariadb
docker pull mariadb
SHELL

Create the MariaDB container using this command:

docker run -d \
  --name nextcloud-db \
  -e MYSQL_ROOT_PASSWORD=your_root_password \
  -e MYSQL_DATABASE=nextcloud \
  -e MYSQL_USER=nextcloud_user \
  -e MYSQL_PASSWORD=your_password \
  mariadb
docker run -d \
  --name nextcloud-db \
  -e MYSQL_ROOT_PASSWORD=your_root_password \
  -e MYSQL_DATABASE=nextcloud \
  -e MYSQL_USER=nextcloud_user \
  -e MYSQL_PASSWORD=your_password \
  mariadb
SHELL

Replace your_root_password and your_password with strong passwords of your choice. This command sets up a MariaDB container named nextcloud-db with a database called nextcloud and a user named nextcloud_user.

Nextcloud Web Interface

Access the Nextcloud installation by opening a web browser and entering the server's IP address or domain name where Nextcloud is hosted. For local installations, use:

http://localhost:8080/

Setup the Admin Account

Upon accessing the setup page, create an admin user. The Nextcloud CLI is also available for managing configurations and setups if needed.

After entering the required information, configure the database connection:

  1. Database host: Use localhost for local databases or the database container name (e.g., nextcloud-db) if using Docker.
  2. Database username and password: Provided during the MariaDB setup.
  3. Database name: nextcloud in this example.

Fill in all the necessary details and click "Finish Setup" to complete the installation.

What is IronSecureDoc?

IronSecureDoc is a document security tool used for encrypting, redacting, and digitally signing sensitive files. It secures PDFs, allowing users to control personal data and confidential information effectively.

Install and Running IronSecureDoc

Pull the IronSecureDoc Docker image using:

docker pull ironsoftwareofficial/ironsecuredoc
docker pull ironsoftwareofficial/ironsecuredoc
SHELL

To run the IronSecureDoc container, use:

docker container run --rm -p 8080:8080 \
  -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> \
  -e ENVIRONMENT=Development \
  -e HTTP_PORTS=8080 \
  ironsoftwareofficial/ironsecuredoc:latest
docker container run --rm -p 8080:8080 \
  -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> \
  -e ENVIRONMENT=Development \
  -e HTTP_PORTS=8080 \
  ironsoftwareofficial/ironsecuredoc:latest
SHELL

Replace <IRONSECUREDOC_LICENSE_KEY> with your actual license key. This command launches the IronSecureDoc container, exposing it on port 8080.

Using IronSecureDoc with Docker Container

IronSecureDoc can be accessed through its REST API after installation. Documentation and API endpoints can be found at http://localhost:8080/swagger/index.html.

To submit a document for encryption, use a POST request via curl:

curl -X 'POST' \
  'http://localhost:8080/v1/document-services/pdfs/encrypt?user_password=demo' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@test.pdf;type=application/pdf'
curl -X 'POST' \
  'http://localhost:8080/v1/document-services/pdfs/encrypt?user_password=demo' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@test.pdf;type=application/pdf'
SHELL

This forwards the document to IronSecureDoc, applying the appropriate encryption.

Conclusion

Nextcloud and IronSecureDoc serve different purposes in secure data handling. Nextcloud is a robust, self-hosted cloud platform for managing and sharing data, offering full privacy control and scalability via Docker. IronSecureDoc provides advanced document encryption, ensuring secure handling of sensitive files. Integrating with Docker makes both solutions suitable for scalable, secure environments.

Click here for more information on IronSecureDoc licensing. For more information on product lines offered by Iron Software, check here.

常见问题解答

Docker Compose 如何简化 Nextcloud 的部署?

Docker Compose 允许您编排多容器应用程序,通过将 Nextcloud 的所有依赖项打包到隔离、可移植和可扩展的容器中,使其部署变得简单。

使用 Docker 部署 Nextcloud 有何优势?

使用 Docker 部署 Nextcloud 的优势包括简化设置、增强可移植性、隔离、可扩展性、持久存储、轻松升级和改进的安全性。

如何使用 Docker 设置 Nextcloud?

您可以通过使用命令docker pull nextcloud拉取官方 Nextcloud Docker 镜像并使用docker run -d -p 8080:80 nextcloud运行它来设置 Nextcloud。

Docker 设置中的 Nextcloud 涉及哪些组件?

Nextcloud 的 Docker 设置通常涉及应用程序本身、数据库和缓存服务的单独容器,每个容器由 Docker Compose 管理,以确保模块化和可扩展性。

IronSecureDoc 如何增强 Nextcloud 的数据安全性?

IronSecureDoc 通过提供高级文档加密、删减和数字签名功能来增强 Nextcloud 的数据安全性,确保敏感文件在 Docker 环境中可以安全处理。

IronSecureDoc 可以与 Docker 集成用于 Nextcloud 的部署吗?

是的,IronSecureDoc 可以通过使用其 Docker 镜像与 Docker 集成以增强 Nextcloud 的部署。这种集成允许在 Docker 化环境中通过其 REST API 进行安全的文档处理。

为什么选择像 Nextcloud 的自托管解决方案而不是云提供商?

选择像 Nextcloud 这样的自托管解决方案而不是云提供商可以提供完整的隐私控制、数据主权,以及根据特定组织需求自定义环境的能力,同时利用 Docker 进行高效部署。

Docker 在确保 Nextcloud 跨不同环境性能稳定中扮演什么角色?

Docker 通过将应用程序及其所有依赖项封装到一个单独的容器中来确保 Nextcloud 在不同环境中的性能一致,这防止了冲突并简化了部署过程。

Docker 和 Nextcloud 如何协作提供可扩展的云存储解决方案?

Docker 和 Nextcloud 通过使用容器高效地管理和扩展应用程序,允许在需求增长时轻松添加资源和服务,同时维护数据完整性和安全性。

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。