py-docker-admin 0.6.1__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/PKG-INFO +70 -8
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/README.md +69 -7
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/__init__.py +1 -1
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2/py_docker_admin}/templates/nginx_config.j2 +14 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/pyproject.toml +1 -1
- {py_docker_admin-0.6.1/py_docker_admin → py_docker_admin-0.6.2}/templates/nginx_config.j2 +14 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/.gitignore +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/AUTHORS +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/LICENSE +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/__main__.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/cli.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/docker.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/exceptions.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/librechat.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/models.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/nginx.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/portainer.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/stack.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/templates/landing_page.html.j2 +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/templates/site_stylesheet.css +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/utils.py +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/templates/landing_page.html.j2 +0 -0
- {py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/templates/site_stylesheet.css +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: py-docker-admin
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: A Python package for automating Docker and Portainer installation
|
|
5
5
|
Project-URL: Repository, https://gitlab.com/grenzfall/py-docker-admin
|
|
6
6
|
Project-URL: Issues, https://gitlab.com/grenzfall/py-docker-admin/-/issues
|
|
@@ -134,18 +134,80 @@ portainer:
|
|
|
134
134
|
|
|
135
135
|
The `base_url` must start with a forward slash (e.g., `/portainer`, `/docker-admin`). When configured, Portainer container will be started with the `--base-url` parameter, ensuring proper path handling behind reverse proxies.
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
## Persistent Folder Configuration
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
The `persistent_folder` feature allows you to automatically set up and manage persistent storage for Docker containers. This is particularly useful for databases, application data, or any service that requires data persistence across container restarts and updates.
|
|
140
|
+
|
|
141
|
+
### How It Works
|
|
142
|
+
|
|
143
|
+
1. **Creates host directory** - Ensures the specified host directory exists (creates it if it doesn't)
|
|
144
|
+
2. **Copies initial content** - Optionally copies files or directories to the host directory before deployment
|
|
145
|
+
3. **Mounts to container** - The directory is mounted as a volume in the Docker container
|
|
146
|
+
|
|
147
|
+
### Configuration
|
|
148
|
+
|
|
149
|
+
Add `persistent_folder` to your stack configuration in `config.yaml`:
|
|
150
|
+
|
|
151
|
+
```yaml
|
|
152
|
+
stacks:
|
|
153
|
+
- name: myapp
|
|
154
|
+
compose_file: ./docker-compose.yml
|
|
155
|
+
env_file: ./docker-compose.env
|
|
156
|
+
persistent_folder:
|
|
157
|
+
mount_name: app_data # Must match volume name in docker-compose.yml
|
|
158
|
+
host_directory: /var/app_data # Absolute path on host system
|
|
159
|
+
contents: ./initial_data # Optional: file/dir to copy to host_directory
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Docker Compose Integration
|
|
163
|
+
|
|
164
|
+
The `mount_name` must match a volume name defined in your `docker-compose.yml`:
|
|
140
165
|
|
|
141
166
|
```yaml
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
167
|
+
version: '3.8'
|
|
168
|
+
|
|
169
|
+
services:
|
|
170
|
+
myapp:
|
|
171
|
+
image: myapp:latest
|
|
172
|
+
volumes:
|
|
173
|
+
- app_data:/app/data # This matches the mount_name in config
|
|
174
|
+
|
|
175
|
+
volumes:
|
|
176
|
+
app_data: # Volume name that matches mount_name
|
|
177
|
+
driver: local
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Configuration Options
|
|
181
|
+
|
|
182
|
+
- **`mount_name`** (required): Name of the volume in your docker-compose.yml file
|
|
183
|
+
- **`host_directory`** (required): Absolute path on the host system where data will be stored
|
|
184
|
+
- **`contents`** (optional): Path to files or directories to copy to the host_directory before deployment
|
|
185
|
+
|
|
186
|
+
### Example Use Cases
|
|
187
|
+
|
|
188
|
+
**Database persistence:**
|
|
189
|
+
```yaml
|
|
190
|
+
stacks:
|
|
191
|
+
- name: postgres-db
|
|
192
|
+
compose_file: ./postgres-compose.yml
|
|
193
|
+
persistent_folder:
|
|
194
|
+
mount_name: pg_data
|
|
195
|
+
host_directory: /var/persistent/postgres
|
|
196
|
+
contents: ./initial_db_setup
|
|
147
197
|
```
|
|
148
198
|
|
|
199
|
+
**Application data:**
|
|
200
|
+
```yaml
|
|
201
|
+
stacks:
|
|
202
|
+
- name: web-app
|
|
203
|
+
compose_file: ./webapp-compose.yml
|
|
204
|
+
persistent_folder:
|
|
205
|
+
mount_name: app_storage
|
|
206
|
+
host_directory: /var/www/app_data
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
This ensures your container data persists even when containers are recreated or updated, providing reliable data storage across deployments.
|
|
210
|
+
|
|
149
211
|
## Requirements
|
|
150
212
|
|
|
151
213
|
- Python 3.12+
|
|
@@ -101,18 +101,80 @@ portainer:
|
|
|
101
101
|
|
|
102
102
|
The `base_url` must start with a forward slash (e.g., `/portainer`, `/docker-admin`). When configured, Portainer container will be started with the `--base-url` parameter, ensuring proper path handling behind reverse proxies.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
## Persistent Folder Configuration
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
The `persistent_folder` feature allows you to automatically set up and manage persistent storage for Docker containers. This is particularly useful for databases, application data, or any service that requires data persistence across container restarts and updates.
|
|
107
|
+
|
|
108
|
+
### How It Works
|
|
109
|
+
|
|
110
|
+
1. **Creates host directory** - Ensures the specified host directory exists (creates it if it doesn't)
|
|
111
|
+
2. **Copies initial content** - Optionally copies files or directories to the host directory before deployment
|
|
112
|
+
3. **Mounts to container** - The directory is mounted as a volume in the Docker container
|
|
113
|
+
|
|
114
|
+
### Configuration
|
|
115
|
+
|
|
116
|
+
Add `persistent_folder` to your stack configuration in `config.yaml`:
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
stacks:
|
|
120
|
+
- name: myapp
|
|
121
|
+
compose_file: ./docker-compose.yml
|
|
122
|
+
env_file: ./docker-compose.env
|
|
123
|
+
persistent_folder:
|
|
124
|
+
mount_name: app_data # Must match volume name in docker-compose.yml
|
|
125
|
+
host_directory: /var/app_data # Absolute path on host system
|
|
126
|
+
contents: ./initial_data # Optional: file/dir to copy to host_directory
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Docker Compose Integration
|
|
130
|
+
|
|
131
|
+
The `mount_name` must match a volume name defined in your `docker-compose.yml`:
|
|
107
132
|
|
|
108
133
|
```yaml
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
134
|
+
version: '3.8'
|
|
135
|
+
|
|
136
|
+
services:
|
|
137
|
+
myapp:
|
|
138
|
+
image: myapp:latest
|
|
139
|
+
volumes:
|
|
140
|
+
- app_data:/app/data # This matches the mount_name in config
|
|
141
|
+
|
|
142
|
+
volumes:
|
|
143
|
+
app_data: # Volume name that matches mount_name
|
|
144
|
+
driver: local
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Configuration Options
|
|
148
|
+
|
|
149
|
+
- **`mount_name`** (required): Name of the volume in your docker-compose.yml file
|
|
150
|
+
- **`host_directory`** (required): Absolute path on the host system where data will be stored
|
|
151
|
+
- **`contents`** (optional): Path to files or directories to copy to the host_directory before deployment
|
|
152
|
+
|
|
153
|
+
### Example Use Cases
|
|
154
|
+
|
|
155
|
+
**Database persistence:**
|
|
156
|
+
```yaml
|
|
157
|
+
stacks:
|
|
158
|
+
- name: postgres-db
|
|
159
|
+
compose_file: ./postgres-compose.yml
|
|
160
|
+
persistent_folder:
|
|
161
|
+
mount_name: pg_data
|
|
162
|
+
host_directory: /var/persistent/postgres
|
|
163
|
+
contents: ./initial_db_setup
|
|
114
164
|
```
|
|
115
165
|
|
|
166
|
+
**Application data:**
|
|
167
|
+
```yaml
|
|
168
|
+
stacks:
|
|
169
|
+
- name: web-app
|
|
170
|
+
compose_file: ./webapp-compose.yml
|
|
171
|
+
persistent_folder:
|
|
172
|
+
mount_name: app_storage
|
|
173
|
+
host_directory: /var/www/app_data
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
This ensures your container data persists even when containers are recreated or updated, providing reliable data storage across deployments.
|
|
177
|
+
|
|
116
178
|
## Requirements
|
|
117
179
|
|
|
118
180
|
- Python 3.12+
|
|
@@ -93,6 +93,13 @@ http {
|
|
|
93
93
|
{% for site in sites %}
|
|
94
94
|
{% if not site.server_site.startswith('/') %}
|
|
95
95
|
|
|
96
|
+
# HTTP to HTTPS redirect for {{ site.site_name }} on port {{ site.server_site }}
|
|
97
|
+
server {
|
|
98
|
+
listen {{ site.server_site }};
|
|
99
|
+
server_name {{ server_name }};
|
|
100
|
+
return 301 https://$host:$server_port$request_uri;
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
# New server block for {{ site.site_name }} on port {{ site.server_site }}
|
|
97
104
|
server {
|
|
98
105
|
listen {{ site.server_site }} ssl;
|
|
@@ -116,9 +123,16 @@ http {
|
|
|
116
123
|
proxy_set_header X-Real-IP $remote_addr;
|
|
117
124
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
118
125
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
126
|
+
proxy_set_header X-Forwarded-Port $server_port;
|
|
127
|
+
proxy_set_header X-Forwarded-Host $host;
|
|
128
|
+
proxy_set_header X-Script-Name /;
|
|
119
129
|
proxy_set_header Upgrade $http_upgrade;
|
|
120
130
|
proxy_set_header Connection "upgrade";
|
|
121
131
|
proxy_http_version 1.1;
|
|
132
|
+
|
|
133
|
+
# Rewrite redirects to use correct protocol and port
|
|
134
|
+
proxy_redirect http:// https://;
|
|
135
|
+
proxy_redirect http://$host/ https://$host:{{ site.server_site }}/;
|
|
122
136
|
}
|
|
123
137
|
}
|
|
124
138
|
{% endif %}
|
|
@@ -93,6 +93,13 @@ http {
|
|
|
93
93
|
{% for site in sites %}
|
|
94
94
|
{% if not site.server_site.startswith('/') %}
|
|
95
95
|
|
|
96
|
+
# HTTP to HTTPS redirect for {{ site.site_name }} on port {{ site.server_site }}
|
|
97
|
+
server {
|
|
98
|
+
listen {{ site.server_site }};
|
|
99
|
+
server_name {{ server_name }};
|
|
100
|
+
return 301 https://$host:$server_port$request_uri;
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
# New server block for {{ site.site_name }} on port {{ site.server_site }}
|
|
97
104
|
server {
|
|
98
105
|
listen {{ site.server_site }} ssl;
|
|
@@ -116,9 +123,16 @@ http {
|
|
|
116
123
|
proxy_set_header X-Real-IP $remote_addr;
|
|
117
124
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
118
125
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
126
|
+
proxy_set_header X-Forwarded-Port $server_port;
|
|
127
|
+
proxy_set_header X-Forwarded-Host $host;
|
|
128
|
+
proxy_set_header X-Script-Name /;
|
|
119
129
|
proxy_set_header Upgrade $http_upgrade;
|
|
120
130
|
proxy_set_header Connection "upgrade";
|
|
121
131
|
proxy_http_version 1.1;
|
|
132
|
+
|
|
133
|
+
# Rewrite redirects to use correct protocol and port
|
|
134
|
+
proxy_redirect http:// https://;
|
|
135
|
+
proxy_redirect http://$host/ https://$host:{{ site.server_site }}/;
|
|
122
136
|
}
|
|
123
137
|
}
|
|
124
138
|
{% endif %}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/templates/landing_page.html.j2
RENAMED
|
File without changes
|
{py_docker_admin-0.6.1 → py_docker_admin-0.6.2}/py_docker_admin/templates/site_stylesheet.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|