python-ship 0.1.0__tar.gz → 0.2.0__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.
- {python_ship-0.1.0 → python_ship-0.2.0}/MANIFEST.in +0 -1
- {python_ship-0.1.0/src/python_ship.egg-info → python_ship-0.2.0}/PKG-INFO +116 -98
- {python_ship-0.1.0 → python_ship-0.2.0}/README.md +114 -96
- {python_ship-0.1.0 → python_ship-0.2.0}/docs/adding-a-service.md +23 -5
- python_ship-0.2.0/docs/build-environment.md +38 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/docs/releasing.md +14 -10
- python_ship-0.2.0/docs/upgrading.md +24 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/pyproject.toml +3 -2
- python_ship-0.2.0/schema/service-environment.json +22 -0
- python_ship-0.2.0/schema/ship-release.schema.json +145 -0
- python_ship-0.2.0/schema/ship.schema.json +479 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/__init__.py +1 -1
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/adapters.py +56 -7
- python_ship-0.2.0/src/python_ship/build_environment.py +60 -0
- python_ship-0.2.0/src/python_ship/capabilities.py +43 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/cli.py +115 -20
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/compose.py +64 -11
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/config.py +66 -14
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/contracts.py +25 -0
- python_ship-0.2.0/src/python_ship/environment.py +77 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/init.py +118 -13
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/mutagen.py +1 -1
- python_ship-0.2.0/src/python_ship/package_managers.py +135 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/plugins.py +1 -1
- python_ship-0.2.0/src/python_ship/portable.py +112 -0
- python_ship-0.2.0/src/python_ship/portable_data.py +512 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/production.py +3 -3
- python_ship-0.2.0/src/python_ship/release.py +299 -0
- python_ship-0.2.0/src/python_ship/schema/service-environment.json +22 -0
- python_ship-0.2.0/src/python_ship/schema/ship-release.schema.json +145 -0
- python_ship-0.2.0/src/python_ship/schema/ship.schema.json +479 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/servers.py +4 -4
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/services.py +60 -38
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/storage.py +6 -3
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/stubs.py +42 -8
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/templates/Dockerfile +15 -3
- python_ship-0.2.0/src/python_ship/templates/app-entrypoint.py +39 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/uv.py +3 -1
- python_ship-0.2.0/src/python_ship/wizard.py +77 -0
- {python_ship-0.1.0 → python_ship-0.2.0/src/python_ship.egg-info}/PKG-INFO +116 -98
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship.egg-info/SOURCES.txt +25 -2
- python_ship-0.2.0/src/python_ship.egg-info/requires.txt +2 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/django_app/project/settings.py +2 -2
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/fastapi_app/main.py +2 -2
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/flask_app/app.py +2 -2
- python_ship-0.2.0/tests/test_build_environment.py +46 -0
- python_ship-0.2.0/tests/test_capabilities.py +66 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_cli.py +5 -1
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_compose.py +27 -15
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_config.py +1 -1
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_docker_development.py +5 -1
- python_ship-0.2.0/tests/test_docker_portable.py +85 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_docker_production.py +11 -8
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_docker_release.py +10 -6
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_docker_services.py +2 -11
- python_ship-0.2.0/tests/test_docker_tooling.py +81 -0
- python_ship-0.2.0/tests/test_environment.py +55 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_init.py +31 -12
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_mutagen.py +6 -10
- python_ship-0.2.0/tests/test_package_managers.py +60 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_plugins.py +1 -1
- python_ship-0.2.0/tests/test_portable_services.py +54 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_production.py +9 -4
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_release.py +26 -23
- python_ship-0.2.0/tests/test_release_contract.py +71 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_schema.py +1 -1
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_services.py +33 -19
- python_ship-0.2.0/tests/test_shared_contract.py +45 -0
- python_ship-0.2.0/tests/test_wizard_terminal.py +46 -0
- python_ship-0.1.0/CHANGELOG.md +0 -42
- python_ship-0.1.0/docs/roadmap.md +0 -215
- python_ship-0.1.0/schema/ship.schema.json +0 -128
- python_ship-0.1.0/src/python_ship/release.py +0 -175
- python_ship-0.1.0/src/python_ship.egg-info/requires.txt +0 -1
- {python_ship-0.1.0 → python_ship-0.2.0}/LICENSE.md +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/examples/community-adapter/README.md +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/examples/community-adapter/pyproject.toml +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/examples/community-adapter/src/ship_example_starlette_adapter/__init__.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/examples/community-service/README.md +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/examples/community-service/pyproject.toml +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/examples/community-service/src/ship_example_http_service/__init__.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/setup.cfg +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/__main__.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/py.typed +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/runtime.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/security.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/templates/check-python-security-floor.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/templates/garage/Dockerfile +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship/templates/garage/garage.toml +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship.egg-info/dependency_links.txt +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship.egg-info/entry_points.txt +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/src/python_ship.egg-info/top_level.txt +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/__init__.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/django_app/manage.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/django_app/project/__init__.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/django_app/project/asgi.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/django_app/project/urls.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/django_app/project/views.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/django_app/requirements.txt +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/fastapi_app/requirements.txt +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/flask_app/requirements.txt +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/fixtures/plain_asgi/main.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/helpers.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_adapters.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_extensions.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_plain_asgi_http.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_runtime.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_security.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_servers.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/test_uv.py +0 -0
- {python_ship-0.1.0 → python_ship-0.2.0}/tests/vite.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-ship
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Framework-agnostic, cross-platform Docker development environment and portable releases for Python web apps.
|
|
5
5
|
Author: python-ship
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,7 +8,6 @@ Project-URL: Homepage, https://github.com/ship-ecosystem/python-ship
|
|
|
8
8
|
Project-URL: Documentation, https://github.com/ship-ecosystem/python-ship#readme
|
|
9
9
|
Project-URL: Repository, https://github.com/ship-ecosystem/python-ship
|
|
10
10
|
Project-URL: Issues, https://github.com/ship-ecosystem/python-ship/issues
|
|
11
|
-
Project-URL: Changelog, https://github.com/ship-ecosystem/python-ship/blob/main/CHANGELOG.md
|
|
12
11
|
Keywords: docker,docker-compose,development-environment,asgi,django,fastapi,uv,devops
|
|
13
12
|
Classifier: Development Status :: 4 - Beta
|
|
14
13
|
Classifier: Environment :: Console
|
|
@@ -30,6 +29,7 @@ Requires-Python: >=3.11
|
|
|
30
29
|
Description-Content-Type: text/markdown
|
|
31
30
|
License-File: LICENSE.md
|
|
32
31
|
Requires-Dist: typer<1,>=0.27
|
|
32
|
+
Requires-Dist: questionary<3,>=2.1
|
|
33
33
|
Dynamic: license-file
|
|
34
34
|
|
|
35
35
|
# python-ship
|
|
@@ -43,20 +43,13 @@ Dynamic: license-file
|
|
|
43
43
|
|
|
44
44
|
A framework-agnostic, cross-platform Docker development environment for
|
|
45
45
|
Python web apps, with portable production releases. It is the Python member
|
|
46
|
-
of the Ship ecosystem, alongside [PHP Ship](https://github.com/php-ship
|
|
46
|
+
of the Ship ecosystem, alongside [PHP Ship](https://github.com/ship-ecosystem/php-ship):
|
|
47
47
|
the same commands, the same `ship.json` vocabulary and the same release
|
|
48
48
|
artifact, for any ASGI or WSGI app — a plain callable, Django, FastAPI or
|
|
49
49
|
Flask built in, anything else through a community adapter.
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
end-to-end against a real Docker daemon, for a framework-free app, a Django,
|
|
54
|
-
a FastAPI and a Flask app alike, on Uvicorn, Hypercorn, Gunicorn or Granian: development stacks with a real database and
|
|
55
|
-
cache, production images, and releases booted on a machine with nothing but
|
|
56
|
-
Docker. CI runs the unit suite on Linux, macOS and Windows with Python
|
|
57
|
-
3.11–3.15, and the Docker suites on every push to `main`. See
|
|
58
|
-
[`docs/roadmap.md`](https://github.com/ship-ecosystem/python-ship/blob/main/docs/roadmap.md)
|
|
59
|
-
for what's built and what's next.
|
|
51
|
+
Ship supports Uvicorn, Hypercorn, Gunicorn, and Granian. See
|
|
52
|
+
[upgrading an existing project](docs/upgrading.md) for configuration and data migrations.
|
|
60
53
|
|
|
61
54
|
## Contents
|
|
62
55
|
|
|
@@ -104,7 +97,7 @@ otherwise rebuild by hand:
|
|
|
104
97
|
server needs nothing but Docker — see
|
|
105
98
|
[Production releases](#production-releases).
|
|
106
99
|
- **A real database shell without a published port.** `ship db` opens
|
|
107
|
-
|
|
100
|
+
the database client inside the database container, reading its credentials from
|
|
108
101
|
that container's own environment.
|
|
109
102
|
- **Not tied to a framework.** The core knows nothing about Django or
|
|
110
103
|
FastAPI; both are [`FrameworkAdapter`](https://github.com/ship-ecosystem/python-ship/blob/main/src/python_ship/contracts.py)
|
|
@@ -127,7 +120,7 @@ otherwise rebuild by hand:
|
|
|
127
120
|
- [uv](https://docs.astral.sh/uv/) on the host. `ship init` offers to install
|
|
128
121
|
it with Astral's official installer if it's missing, and makes no changes to
|
|
129
122
|
the project if you decline.
|
|
130
|
-
- An ASGI app. Nothing else: no framework, no dependency manifest, no local
|
|
123
|
+
- An ASGI or WSGI app. Nothing else: no framework, no dependency manifest, no local
|
|
131
124
|
database, no Node install.
|
|
132
125
|
|
|
133
126
|
## Quick start
|
|
@@ -143,8 +136,7 @@ ship shell # drop into the app container
|
|
|
143
136
|
ship down
|
|
144
137
|
```
|
|
145
138
|
|
|
146
|
-
`ship init` detects Django (`manage.py`) and
|
|
147
|
-
suggests the ASGI target to serve. A framework-free app works too — save this
|
|
139
|
+
`ship init` detects Django (`manage.py`), FastAPI and Flask (instances or factories), then suggests the compatible target and server. A framework-free app works too — save this
|
|
148
140
|
as `main.py` and run `ship init`:
|
|
149
141
|
|
|
150
142
|
```python
|
|
@@ -171,19 +163,21 @@ Production is a separate pair of commands, not a flag on `ship up` — see
|
|
|
171
163
|
|
|
172
164
|
| Command | What it does |
|
|
173
165
|
|---|---|
|
|
174
|
-
| `ship init` | Interactive picker for the framework, ASGI target, server and services (database, cache, storage, ...); writes `ship.json` and publishes `ship/`.
|
|
166
|
+
| `ship init` | Interactive picker for the framework, ASGI target, server and services (database, cache, storage, ...); writes `ship.json` and publishes `ship/`. Scriptable flags cover services, instances, processes and networks (`ship init --help`). Re-run it to change selections — see [Adding a service later](#adding-a-service-later). |
|
|
175
167
|
| `ship up` | Regenerates `ship/docker-compose.generated.yml` from `ship.json`, runs `docker compose up --build`, then waits until every container is running, every healthcheck passes and the app answers HTTP. Development only. |
|
|
176
168
|
| `ship build` | Builds every project-owned production image, tagged locally. Needs `.env.production` as soon as a selected service has a required credential. See [Production releases](#production-releases). |
|
|
177
|
-
| `ship release --tag <tag
|
|
169
|
+
| `ship release --tag <tag> [--force] [--no-env]` | Builds the same images (re-tagged) and assembles the portable release under `dist/ship/<tag>/`. |
|
|
178
170
|
| `ship down [--volumes]` | `docker compose down`. `--volumes` also deletes named volumes (database and storage data — use with care). |
|
|
179
171
|
| `ship exec <service> <cmd...>` | Runs a command inside a running service. The generic escape hatch every shortcut below wraps. |
|
|
180
172
|
| `ship shell [service]` | Opens a shell (`sh`) in a service; defaults to the app. |
|
|
181
173
|
| `ship logs [service] [-f]` | Shows logs for one service, or all of them. `-f`/`--follow` streams. |
|
|
182
|
-
| `ship db [instance]` | Opens the database's client (`psql`/`mysql`) with credentials from its own container. Name one of `additionalServices`' databases to open that instance instead. |
|
|
174
|
+
| `ship db [instance]` | Opens the database's client (`psql`/`mysql`/`mariadb`/`mongosh`/`sqlcmd`) with credentials from its own container. Name one of `additionalServices`' databases to open that instance instead. |
|
|
183
175
|
| `ship config:test` | Validates `ship.json`, `ship/`, both Compose models, and production credentials in `.env.production` — without Docker. Reports every problem it finds in one pass. |
|
|
184
176
|
| `ship doctor` | Shows the installed and published versions and the state and health of every container, with a recovery hint for anything that crashed. |
|
|
185
177
|
| `ship uv <args...>` | Runs uv dependency commands (`add`, `remove`, `lock`, `tree`, ...) in a temporary container with the project's Python. See [Dependencies](#dependencies-and-ship-uv). |
|
|
186
|
-
| `ship npm <args...>` | Runs
|
|
178
|
+
| `ship npm/pnpm/yarn <args...>` | Runs the selected, exactly pinned tool in the Node frontend service. The manifest and lockfile remain authoritative. |
|
|
179
|
+
| `ship package-manager TOOL[@VERSION] [--yes]` | Switches the frontend tool in its running container, records the pin and reinstalls; restores recorded files and dependencies after installation failure. Rebuild with `ship up`. |
|
|
180
|
+
| `ship test [-- ARGS...]` | Runs Cypress on demand, or Python pytest against the selected Selenium/Playwright service. Install/configure the application's test client first. |
|
|
187
181
|
| `ship manage <args...>` | Runs `python manage.py` in the app — only registered for Django projects. |
|
|
188
182
|
| `ship flask <args...>` | Runs the `flask` CLI in the app (`FLASK_APP` is set) — only registered for Flask projects. A community adapter registers its own commands the same way. |
|
|
189
183
|
| `ship --version` | Shows the installed python-ship version. |
|
|
@@ -204,16 +198,25 @@ read them — that stays your app's decision.
|
|
|
204
198
|
|
|
205
199
|
| Service | Wired automatically | Still needed in the app |
|
|
206
200
|
|---|---|---|
|
|
207
|
-
| PostgreSQL (`postgres`, or `pgsql`) | `DB_HOST`/`DB_PORT`/`
|
|
201
|
+
| PostgreSQL (`postgres`, or `pgsql`) | `DB_HOST`/`DB_PORT`/`DB_DATABASE`/`DB_USERNAME`/`DB_PASSWORD`, `ship db` | A driver such as `psycopg[binary]`, and settings that read `DB_*` |
|
|
208
202
|
| MySQL (`mysql`) | The same `DB_*` variables, a separate `DB_ROOT_PASSWORD` the app never receives, `ship db` | A driver such as `mysqlclient` or `PyMySQL` |
|
|
203
|
+
| MariaDB (`mariadb`) | `DB_HOST`/`DB_PORT`/`DB_DATABASE`/`DB_USERNAME`/`DB_PASSWORD`, separate admin credential and `ship db` | A Python MySQL/MariaDB driver and framework settings |
|
|
204
|
+
| MongoDB (`mongodb`) | Separate application/admin users, structured connection settings and encoded `MONGODB_URI` at application start, `ship db` | A MongoDB client; select/configure the framework backend explicitly |
|
|
205
|
+
| SQL Server (`sqlserver`) | Application database/login, separate admin credential, `DB_*`, `ship db` | A Python driver and any native libraries it needs; an appropriate production license |
|
|
206
|
+
| Valkey (`valkey`) | `REDIS_HOST`/`REDIS_PORT`, persistent Redis-compatible protocol | A Redis-compatible client; construct the connection from the injected settings |
|
|
207
|
+
| Memcached (`memcached`) | `MEMCACHED_HOST`/`MEMCACHED_PORT`; ephemeral cache | A Memcached client; do not use it for persistent queues |
|
|
208
|
+
| Elasticsearch (`elasticsearch`) | Authenticated single-node service, `ELASTICSEARCH_*` | An Elasticsearch client and suitable host resources |
|
|
209
|
+
| Typesense (`typesense`) | Persistent service, `TYPESENSE_HOST`/`PORT`/`PROTOCOL`/`API_KEY` | A Typesense client and application collection schemas |
|
|
210
|
+
| Centrifugo (`centrifugo`) | HTTP publishing API, token secret and WebSocket endpoint; optional Redis/Valkey engine | Application publishing/token logic and browser client; production origins and real credentials |
|
|
211
|
+
| Cypress (`cypress`) | On-demand development browser container and internal base URL | Cypress tests/configuration; run `ship test` |
|
|
209
212
|
| Redis (`redis`) | `REDIS_URL`; RDB snapshots plus an append-only log | `redis` |
|
|
210
213
|
| RabbitMQ (`rabbitmq`, broker group) | `AMQP_URL`; management UI on `127.0.0.1:${RABBITMQ_MANAGEMENT_PORT:-15672}` in development | A client such as `kombu` or `pika`, or just Celery |
|
|
211
|
-
| Celery (`celery`, tasks group) | A worker
|
|
214
|
+
| Celery (`celery`, tasks group) | A worker container from the app's image; `CELERY_BROKER_URL`, `CELERY_RESULT_BACKEND`, `CELERY_APP` | `celery` in your dependencies — see [Background tasks](#background-tasks-celery) |
|
|
212
215
|
| Mailpit (`mailpit`) | `MAIL_HOST`/`MAIL_PORT` (SMTP), web UI on `127.0.0.1:${MAILPIT_WEB_PORT:-8025}`. Development only | Nothing for `smtplib`; point your framework's mail settings at the variables |
|
|
213
216
|
| Meilisearch (`meilisearch`) | `MEILISEARCH_URL`/`MEILISEARCH_KEY` | `meilisearch` (or plain HTTP) |
|
|
214
217
|
| Garage / SeaweedFS / RustFS / Silo | `AWS_ENDPOINT`/`AWS_USE_PATH_STYLE_ENDPOINT`/`AWS_DEFAULT_REGION`/`AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY`/`AWS_BUCKET` | `boto3` with path-style addressing. Garage creates its bucket; with the others, create `AWS_BUCKET` once. Silo has two image variants — see [Silo on older CPUs](#silo-on-older-cpus) |
|
|
215
218
|
| Selenium (`selenium`) | A Chrome grid, `SELENIUM_REMOTE_URL`, `APP_URL`. Development only | `selenium` in your test dependencies |
|
|
216
|
-
| Playwright (`playwright`) | A browser server, `PLAYWRIGHT_WS_URL`, `APP_URL`. Development only | `playwright==1.
|
|
219
|
+
| Playwright (`playwright`) | A browser server, `PLAYWRIGHT_WS_URL`, `APP_URL`. Development only | `playwright==1.65.1` — the client must match the server version |
|
|
217
220
|
| Node.js (`node`) | A Node container for `ship npm`, Vite's port published. Development only | See [Frontend dev server](#frontend-dev-server-vite-hmr) |
|
|
218
221
|
|
|
219
222
|
Connecting a Django app to the injected variables:
|
|
@@ -224,7 +227,7 @@ import os
|
|
|
224
227
|
DATABASES = {"default": {
|
|
225
228
|
"ENGINE": "django.db.backends.postgresql",
|
|
226
229
|
"HOST": os.environ["DB_HOST"], "PORT": os.environ["DB_PORT"],
|
|
227
|
-
"NAME": os.environ["
|
|
230
|
+
"NAME": os.environ["DB_DATABASE"], "USER": os.environ["DB_USERNAME"],
|
|
228
231
|
"PASSWORD": os.environ["DB_PASSWORD"],
|
|
229
232
|
}}
|
|
230
233
|
CACHES = {"default": {"BACKEND": "django.core.cache.backends.redis.RedisCache",
|
|
@@ -254,22 +257,28 @@ with sync_playwright() as playwright:
|
|
|
254
257
|
page.goto(os.environ["APP_URL"])
|
|
255
258
|
```
|
|
256
259
|
|
|
257
|
-
|
|
260
|
+
Built-in images use reviewed tags or digests; release registry references are pinned to their repository digest. Representative images:
|
|
258
261
|
|
|
259
262
|
| Service | Image |
|
|
260
263
|
|---|---|
|
|
261
|
-
| PostgreSQL | `postgres:
|
|
264
|
+
| PostgreSQL | `postgres:18.7-alpine` |
|
|
262
265
|
| MySQL | `mysql:9.7.4` |
|
|
263
266
|
| Redis | `redis:8.10.3-alpine3.23` |
|
|
264
|
-
|
|
|
265
|
-
|
|
|
267
|
+
| RabbitMQ | `rabbitmq:4.4.1-management-alpine` |
|
|
268
|
+
| Mailpit | `axllent/mailpit:v1.34.0` |
|
|
269
|
+
| Meilisearch | `getmeili/meilisearch:v1.57.0` |
|
|
266
270
|
| Garage | `dxflrs/garage:v2.5.0` (built from `ship/garage/`) |
|
|
267
|
-
| SeaweedFS | `chrislusf/seaweedfs:4.
|
|
268
|
-
| RustFS | `rustfs/rustfs:1.0.
|
|
269
|
-
| Silo | `pgsty/silo:RELEASE.2026-
|
|
270
|
-
| Selenium | `selenium/standalone-
|
|
271
|
-
| Playwright | `mcr.microsoft.com/playwright:v1.
|
|
272
|
-
| Node.js |
|
|
271
|
+
| SeaweedFS | `ghcr.io/chrislusf/seaweedfs:4.47` |
|
|
272
|
+
| RustFS | `rustfs/rustfs:1.0.6` |
|
|
273
|
+
| Silo | `pgsty/silo:RELEASE.2026-11-12T00-00-00Z` |
|
|
274
|
+
| Selenium | `selenium/standalone-chromium:4.53.0-20261120` |
|
|
275
|
+
| Playwright | `mcr.microsoft.com/playwright:v1.65.1-noble` |
|
|
276
|
+
| Node.js | Reviewed digest-pinned Node 22/24/26 image (`node` field) |
|
|
277
|
+
|
|
278
|
+
Ship rebuilds PostgreSQL, MySQL, Typesense, Elasticsearch, SeaweedFS and the development-only Cypress image
|
|
279
|
+
with distribution package updates. Portable releases include the rebuilt
|
|
280
|
+
production service images. Run `ship init --force` after reviewing local template
|
|
281
|
+
edits to pick up the updated Python runtime Dockerfile.
|
|
273
282
|
|
|
274
283
|
### Silo on older CPUs
|
|
275
284
|
|
|
@@ -318,13 +327,13 @@ names match PHP Ship's `ship.json`, so a team using both reads one format:
|
|
|
318
327
|
}
|
|
319
328
|
```
|
|
320
329
|
|
|
321
|
-
- `$schema` — the shared [ship.json schema](https://github.com/ship-ecosystem/
|
|
330
|
+
- `$schema` — the shared [ship.json schema](https://github.com/ship-ecosystem/spec/blob/main/schemas/ship.schema.json),
|
|
322
331
|
written by `ship init` so editors validate and complete the file. PHP Ship
|
|
323
332
|
uses the same schema.
|
|
324
333
|
- `framework` — the adapter: `generic` (any ASGI or WSGI callable), `django`,
|
|
325
334
|
`fastapi`, `flask`, or a community adapter's key.
|
|
326
335
|
- `app` — the ASGI or WSGI target to serve, `module:callable`. A module
|
|
327
|
-
under `src/` works too.
|
|
336
|
+
under `src/` works too. Flask factories may use `app:create_app()`; project code is never imported on the host for detection.
|
|
328
337
|
- `python` — the Python branch built into the image (`ARG PYTHON_VERSION`).
|
|
329
338
|
Keep it a bare branch (`"3.13"`) so every build gets that branch's latest
|
|
330
339
|
patch release. See [Python security floor](#python-security-floor).
|
|
@@ -334,14 +343,13 @@ names match PHP Ship's `ship.json`, so a team using both reads one format:
|
|
|
334
343
|
[Web servers](#web-servers-asgi-and-wsgi).
|
|
335
344
|
- `services` — one selected service per group; a group without an entry
|
|
336
345
|
means "none". PostgreSQL is `postgres`; `pgsql`, PHP Ship's original name,
|
|
337
|
-
is accepted too (and in `additionalServices` and `serviceNames`), so
|
|
338
|
-
`ship.json` written by either package reads the same in both.
|
|
346
|
+
is accepted too (and in `additionalServices` and `serviceNames`), so service identifiers stay aligned across the ecosystem. Language-specific fields remain producer-specific.
|
|
339
347
|
- `additionalServices` — extra, named instances (a second database, a second
|
|
340
348
|
Redis, ...). See [Multiple instances of a service](#multiple-instances-of-a-service).
|
|
341
349
|
- `extensions` — entry point names of installed community adapters, services
|
|
342
350
|
and servers to load. See [Extending ship](#extending-ship).
|
|
343
351
|
- `serviceNames` / `externalNetwork` — rename Compose services and attach the
|
|
344
|
-
app to
|
|
352
|
+
app and HTTP services to pre-existing Docker networks. `externalNetwork` accepts a name or nonempty list of names. See
|
|
345
353
|
[Custom service names and an external network](#custom-service-names-and-an-external-network).
|
|
346
354
|
- `name` — the Compose project name; defaults to the directory name. See
|
|
347
355
|
[Running more than one project at once](#running-more-than-one-project-at-once).
|
|
@@ -377,16 +385,27 @@ names match PHP Ship's `ship.json`, so a team using both reads one format:
|
|
|
377
385
|
```
|
|
378
386
|
Each becomes its own Compose service with the app's image, environment and
|
|
379
387
|
networks, no published ports, and a 60s stop grace period so a worker can
|
|
380
|
-
finish its job. They run in development
|
|
381
|
-
code. Write each as a shell command, `$VAR` included — Ship escapes every
|
|
388
|
+
finish its job. They run only in production. Start development workers explicitly, or use a development override. Write each as a shell command, `$VAR` included — Ship escapes every
|
|
382
389
|
`$` so Compose doesn't blank out a variable meant for the container — or as
|
|
383
390
|
an argument list (`["python", "worker.py"]`) to skip the shell.
|
|
384
|
-
- `
|
|
391
|
+
- `node` — frontend Node branch (`22`, `24` or `26`, default `24`).
|
|
392
|
+
- `build` — explicit public build values and temporary BuildKit credentials; see [build settings](docs/build-environment.md).
|
|
393
|
+
- `nodeAssets` — build npm/pnpm/Yarn assets into the production image. See
|
|
385
394
|
[Frontend dev server](#frontend-dev-server-vite-hmr).
|
|
386
395
|
- `djangoCollectstatic` — run `collectstatic` at every production boot
|
|
387
396
|
(Django only). The files stay in the container, so serve them from the app
|
|
388
397
|
(for example with WhiteNoise) or from a proxy that shares the volume.
|
|
389
398
|
|
|
399
|
+
Processes may also use `{ "command": ..., "healthcheck": ..., "http": ... }`.
|
|
400
|
+
The HTTP block declares a container port, open role, optional health path and
|
|
401
|
+
public URL setting name. It becomes an endpoint in `release.json`.
|
|
402
|
+
|
|
403
|
+
Setup uses arrow-key selections, service checkboxes and Ctrl+U to go back;
|
|
404
|
+
piped input has numbered prompts. `-n` never asks questions. The final preview
|
|
405
|
+
precedes writes. Scriptable flags include `--name`, repeated `--additional-service
|
|
406
|
+
GROUP=PROVIDER:NAME`, `--process NAME=COMMAND_OR_JSON`, `--network`,
|
|
407
|
+
`--deploy-command`, `--remove-instance`, `--remove-process` and `--no-network`.
|
|
408
|
+
|
|
390
409
|
Host-port collisions are handled with environment variables, not `ship.json`
|
|
391
410
|
— see [Running more than one project at once](#running-more-than-one-project-at-once).
|
|
392
411
|
|
|
@@ -468,9 +487,9 @@ The Dockerfile installs your dependencies with uv, in this order:
|
|
|
468
487
|
|
|
469
488
|
| Project has | Image runs |
|
|
470
489
|
|---|---|
|
|
471
|
-
| `uv.lock` + `pyproject.toml` | `uv sync --locked
|
|
490
|
+
| `uv.lock` + `pyproject.toml` | `uv sync --locked`; production prunes dev groups with `--no-dev` |
|
|
472
491
|
| `requirements.txt` | `uv pip install -r requirements.txt` |
|
|
473
|
-
| `pyproject.toml` only | `uv sync
|
|
492
|
+
| `pyproject.toml` only | `uv sync`; production prunes dev groups with `--no-dev` |
|
|
474
493
|
| none of them | nothing — only the web server |
|
|
475
494
|
|
|
476
495
|
Then it installs the selected web server, so a framework-free app with no
|
|
@@ -521,9 +540,10 @@ ship init --cache redis --tasks celery # Redis as broker and res
|
|
|
521
540
|
ship init --broker rabbitmq --cache redis --tasks celery # RabbitMQ broker, Redis results
|
|
522
541
|
```
|
|
523
542
|
|
|
524
|
-
Ship adds
|
|
525
|
-
|
|
526
|
-
`celery-beat`
|
|
543
|
+
Ship adds a worker container from the app's image, with its environment and
|
|
544
|
+
dependencies. In development it also sees the application source. Scheduling
|
|
545
|
+
is independent: add `celery-beat` explicitly as a production process when needed.
|
|
546
|
+
The worker and app receive:
|
|
527
547
|
|
|
528
548
|
| Variable | Value |
|
|
529
549
|
|---|---|
|
|
@@ -544,11 +564,11 @@ celery = Celery("tasks", broker=os.environ["CELERY_BROKER_URL"], backend=os.envi
|
|
|
544
564
|
Django projects follow Celery's own Django guide; with
|
|
545
565
|
`app.config_from_object("django.conf:settings", namespace="CELERY")`, the
|
|
546
566
|
injected `CELERY_BROKER_URL` and `CELERY_RESULT_BACKEND` are picked up as
|
|
547
|
-
settings. Canvas works as usual (`chain`, `group`, `chord`); chords need a
|
|
567
|
+
settings only after your settings module reads those environment variables. Canvas works as usual (`chain`, `group`, `chord`); chords need a
|
|
548
568
|
real result backend, so select Redis. Set `CELERY_LOG_LEVEL` to change the
|
|
549
569
|
log level. In development the worker restarts on code changes when
|
|
550
570
|
`watchfiles` is installed; otherwise run `ship up` after changing tasks. The
|
|
551
|
-
worker
|
|
571
|
+
worker runs in production too, and a release's `deploy-commands.sh`
|
|
552
572
|
starts the broker and database but not them.
|
|
553
573
|
|
|
554
574
|
## Production releases
|
|
@@ -574,17 +594,13 @@ Both build a materially different image from `ship up`'s development one:
|
|
|
574
594
|
- **Fresh base images.** Production builds always pull the base image
|
|
575
595
|
(`build.pull`), so a release never ships on a stale cached Python.
|
|
576
596
|
- **Development-only services disappear.** Mailpit, Selenium, Playwright and
|
|
577
|
-
Node are absent from the production model, along with their variables.
|
|
597
|
+
Node and Cypress are absent from the production model, along with their variables.
|
|
578
598
|
- **No override file.** `docker-compose.override.yml` is a development
|
|
579
599
|
convenience and never reaches a production image.
|
|
580
600
|
|
|
581
601
|
### Python security floor
|
|
582
602
|
|
|
583
|
-
Ship
|
|
584
|
-
vulnerabilities. The current floor comes from the October 2026 expedited
|
|
585
|
-
security releases, which fixed the bundled pip certificate-chain problem,
|
|
586
|
-
tarfile link handling (CVE-2026-114583), and bundled Expat vulnerabilities
|
|
587
|
-
(CVE-2026-77214, CVE-2026-102633):
|
|
603
|
+
Ship enforces the following minimum Python versions for application images.
|
|
588
604
|
|
|
589
605
|
| Branch | Oldest release Ship builds on |
|
|
590
606
|
| --- | --- |
|
|
@@ -612,12 +628,12 @@ ships a security release.
|
|
|
612
628
|
|
|
613
629
|
### `.env.production`
|
|
614
630
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
`
|
|
631
|
+
`ship init` appends required production setting names to `.env.production`
|
|
632
|
+
with empty values, preserving existing values and comments. Fill them before
|
|
633
|
+
building. It also merges development settings into `.env.example` and `.env`.
|
|
634
|
+
`ship config:test`, `build` and `release` reject missing required credentials
|
|
635
|
+
and known development defaults. The release copies the file privately unless
|
|
636
|
+
`--no-env` is requested. With no required settings, an absent file is allowed.
|
|
621
637
|
|
|
622
638
|
Selected services' secrets (`DB_PASSWORD`, `DB_ROOT_PASSWORD`,
|
|
623
639
|
`MEILISEARCH_KEY`, `AWS_SECRET_ACCESS_KEY`, `GARAGE_RPC_SECRET`,
|
|
@@ -625,44 +641,48 @@ Selected services' secrets (`DB_PASSWORD`, `DB_ROOT_PASSWORD`,
|
|
|
625
641
|
*required* in production: Compose itself refuses to start without them, and
|
|
626
642
|
`ship config:test`/`ship build`/`ship release` check before Docker is invoked
|
|
627
643
|
— reporting a missing value, or one still set to a development default such
|
|
628
|
-
as `ship`. Non-secret settings (`
|
|
644
|
+
as `ship`. Non-secret settings (`DB_DATABASE`, `DB_USERNAME`, `AWS_BUCKET`, ...) keep
|
|
629
645
|
their defaults unless you set them.
|
|
630
646
|
|
|
631
647
|
### What `ship release --tag` produces
|
|
632
648
|
|
|
633
649
|
```text
|
|
634
650
|
dist/ship/1.2.0/
|
|
635
|
-
├── docker-compose.yml #
|
|
636
|
-
├── .env #
|
|
637
|
-
├── images/
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
├── deploy-commands.sh # only when deployCommands is set
|
|
642
|
-
└── README.md # the exact commands to deploy this release
|
|
651
|
+
├── docker-compose.yml # no build:, registry images pinned by digest
|
|
652
|
+
├── .env # optional settings, mode 0600
|
|
653
|
+
├── images/app.tar # one archive per unique project-owned image
|
|
654
|
+
├── release.json # canonical ship-release manifest; no secret values
|
|
655
|
+
├── deploy-commands.sh # optional; mode 0755
|
|
656
|
+
└── README.md # exact deployment commands
|
|
643
657
|
```
|
|
644
658
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
659
|
+
The folder is private (0700), assembled under a temporary name and published
|
|
660
|
+
only after success. `release.json` is written last as the completeness marker.
|
|
661
|
+
An existing tag needs explicit `--force`; assembly failure preserves the previous
|
|
662
|
+
artifact. A release requires an explicit stable `name` in ship.json.
|
|
663
|
+
|
|
664
|
+
The manifest records builder/source/platform, immutable image IDs, archive hashes,
|
|
665
|
+
pulled images, service roles, named volumes, HTTP endpoints, environment names,
|
|
666
|
+
external networks, deploy argv and console commands. The contract is maintained
|
|
667
|
+
in [ship-ecosystem/spec](https://github.com/ship-ecosystem/spec).
|
|
653
668
|
|
|
654
|
-
|
|
669
|
+
Only project-built images are archived; database/cache images are digest-pinned
|
|
670
|
+
and require registry access on the destination. For example:
|
|
655
671
|
|
|
656
672
|
```sh
|
|
657
673
|
docker load -i images/app.tar
|
|
658
|
-
|
|
659
|
-
sh deploy-commands.sh
|
|
674
|
+
# Create any external networks recorded in release.json first.
|
|
675
|
+
sh deploy-commands.sh # only when present; infrastructure first, then commands
|
|
660
676
|
docker compose up -d
|
|
661
677
|
```
|
|
662
678
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
679
|
+
With `--no-env`, supply destination settings through `.env` for Compose
|
|
680
|
+
interpolation and application startup. Public frontend values are compiled at
|
|
681
|
+
build time; changing runtime settings cannot change the built assets.
|
|
682
|
+
|
|
683
|
+
Runtime env files, private registry configuration, `.ship-secrets` and previous
|
|
684
|
+
releases are excluded from the build context. Secret values never enter
|
|
685
|
+
release.json. Deployment runs with Docker alone; Ship does not SSH to servers.
|
|
666
686
|
|
|
667
687
|
### CI/CD
|
|
668
688
|
|
|
@@ -760,7 +780,7 @@ its own sync session instead, so events are native and polling is off.
|
|
|
760
780
|
|
|
761
781
|
Set `VITE_PORT` in `.env` to move both sides at once. Node isn't part of the
|
|
762
782
|
production stack. To compile assets into the production image, set
|
|
763
|
-
`nodeAssets` (`ship init --node-assets`), commit
|
|
783
|
+
`nodeAssets` (`ship init --node-assets`), commit the selected tool’s lockfile, and give
|
|
764
784
|
`package.json` a `build` script that writes to `dist/`: the Dockerfile builds
|
|
765
785
|
them in a separate Node stage and copies `dist/` into the Python image, so
|
|
766
786
|
Node never reaches the runtime.
|
|
@@ -818,8 +838,9 @@ so run `ship up` again after changing them. Never applies in production.
|
|
|
818
838
|
|
|
819
839
|
Every generated Compose file carries a top-level `name:` (`ship.json`'s
|
|
820
840
|
`name`, or the sanitized directory name), which scopes networks and volumes,
|
|
821
|
-
and production uses
|
|
822
|
-
|
|
841
|
+
and production uses the same stable project identity, following PHP Ship. Stop a
|
|
842
|
+
development stack before running production on the same daemon. Set `name`
|
|
843
|
+
explicitly when it must stay the same wherever the project is checked out.
|
|
823
844
|
|
|
824
845
|
Every published port has a variable, read from your shell or the project's
|
|
825
846
|
`.env`:
|
|
@@ -867,29 +888,29 @@ without forking Ship. A package registers a Python entry point:
|
|
|
867
888
|
|
|
868
889
|
```toml
|
|
869
890
|
[project.entry-points."python_ship.services"]
|
|
870
|
-
|
|
891
|
+
custom = "ship_custom:CustomService"
|
|
871
892
|
|
|
872
893
|
[project.entry-points."python_ship.adapters"]
|
|
873
|
-
|
|
894
|
+
custom = "ship_custom:CustomAdapter"
|
|
874
895
|
|
|
875
896
|
[project.entry-points."python_ship.servers"]
|
|
876
|
-
|
|
897
|
+
custom = "ship_custom:CustomServer"
|
|
877
898
|
```
|
|
878
899
|
|
|
879
900
|
Install it next to the `ship` command (`uv tool install python-ship --with
|
|
880
|
-
ship-
|
|
901
|
+
ship-custom`) and select it by entry point name:
|
|
881
902
|
|
|
882
903
|
```json
|
|
883
904
|
{
|
|
884
|
-
"extensions": ["
|
|
885
|
-
"services": {"
|
|
905
|
+
"extensions": ["custom"],
|
|
906
|
+
"services": {"custom-group": "custom"}
|
|
886
907
|
}
|
|
887
908
|
```
|
|
888
909
|
|
|
889
910
|
Nothing loads unless `extensions` names it. A missing, duplicate or broken
|
|
890
911
|
extension is a configuration error naming the extension. The contracts —
|
|
891
912
|
`ServiceDefinition`, `FrameworkAdapter`, `WebServer`, and the optional
|
|
892
|
-
`ProvidesDatabaseShell`/`ValidatesConfiguration` — are typed protocols in
|
|
913
|
+
`ProvidesDatabaseShell`/`ValidatesConfiguration`/`DescribesRelease`/`SuggestsProcesses`/`ExposesHttp` — are typed protocols in
|
|
893
914
|
[`python_ship.contracts`](https://github.com/ship-ecosystem/python-ship/blob/main/src/python_ship/contracts.py).
|
|
894
915
|
See [`docs/adding-a-service.md`](https://github.com/ship-ecosystem/python-ship/blob/main/docs/adding-a-service.md)
|
|
895
916
|
for a worked example, and the installable
|
|
@@ -916,10 +937,7 @@ for a worked example, and the installable
|
|
|
916
937
|
|
|
917
938
|
## Contributing
|
|
918
939
|
|
|
919
|
-
See [
|
|
920
|
-
for adding a service or adapter, and
|
|
921
|
-
[`docs/roadmap.md`](https://github.com/ship-ecosystem/python-ship/blob/main/docs/roadmap.md)
|
|
922
|
-
for what's built and what's planned.
|
|
940
|
+
See [adding a service](docs/adding-a-service.md) for service and adapter interfaces.
|
|
923
941
|
|
|
924
942
|
```sh
|
|
925
943
|
python scripts/check_local.py # Ruff, mypy, unit tests, then build and smoke-test both distributions
|