# Client Container Concept and Structure

#### **Container Deployment**

In our deployment scenarios, we use **Docker Compose** for managing client containers.

#### **Important Directories**

The **nginx-proxy** directory must remain unchanged. Its path is:  
`/opt/docker/nginx-proxy`

This directory contains essential components:

- `docker-compose.yml` – Docker Compose configuration
- `certs/` – SSL certificates for domains
- `nginx/` – Nginx configuration files mounted into the container
- `html/` – Web root directory
- `vhost.d/` – Virtual host configurations

**List of required directories:**

<div id="bkmrk-%2Fopt%2Fdocker%2Fnginx-pr"><div></div><div>`<span class="hljs-regexp">/opt/</span>docker<span class="hljs-operator">/</span>nginx<span class="hljs-operator">-</span>proxy  <span class="hljs-regexp">/opt/</span>docker<span class="hljs-regexp">/nginx-proxy/</span>certs  <span class="hljs-regexp">/opt/</span>docker<span class="hljs-regexp">/nginx-proxy/</span>nginx  <span class="hljs-regexp">/opt/</span>docker<span class="hljs-regexp">/nginx-proxy/</span>html  <span class="hljs-regexp">/opt/</span>docker<span class="hljs-regexp">/nginx-proxy/</span>vhost.d  `</div></div>#### **Client Container Data Directories**

Each client container has its own data directory. The base path for storing user-related Docker files and disk images can be set individually for each **n8n workflow** involved in service management.

- The **clients\_dir** option defines the storage directory for user data.
- Default path: `/opt/docker/clients`

[![image-1741877612840.png](https://doc.puq.info/uploads/images/gallery/2025-03/scaled-1680-/image-1741877612840.png)](https://doc.puq.info/uploads/images/gallery/2025-03/image-1741877612840.png)

Within this directory, subdirectories are created based on the **primary domain name** of the service. The domain acts as a reference point for the entire service.

Each service directory contains:

[![image-1741877565421.png](https://doc.puq.info/uploads/images/gallery/2025-03/scaled-1680-/image-1741877565421.png)](https://doc.puq.info/uploads/images/gallery/2025-03/image-1741877565421.png)

- `docker-compose.yml` – Service-specific Docker Compose configuration
- `status` – A file storing the container status, which reflects the billing system state (e.g., **active**, **suspended**, etc.)
- `nginx/` – Nginx proxy configuration for the domain and container
- `data.img` – Disk image for container data

Before a container starts, the `data.img` file is **mounted into the system** using n8n automation. The necessary entries are added to `/etc/fstab`, ensuring that containers automatically restart after a server reboot.