Docker / docker-compose backend strategies for enlace (mode=docker, compose, image, docker_attached)
Project description
enlace_docker
Docker / docker-compose backend strategies for enlace.
Installing this package adds four new mode values to app.toml:
| Mode | What enlace does |
|---|---|
docker |
Build the app's Dockerfile, run the container, supervise, route HTTP to it |
image |
Pull a pre-built image, run it, supervise, route HTTP to it (no build step) |
compose |
docker compose up -d the app's stack, route HTTP to a declared service+port, down on shutdown |
docker_attached |
Route HTTP to an already-running container by name (no lifecycle management) |
No code change in enlace is needed — enlace_docker registers via the
enlace.backend_strategies entry-point group. Installing the package is
enough.
Status
Scope: dev orchestration only. Production runs docker compose up out of
band; enlace routes to it via the built-in mode=external. This package
covers enlace serve / enlace dev. See
enlace#3 for the design.
Install
pip install enlace_docker
Requires the docker CLI on PATH. Compose support requires docker compose
(the v2 plugin, not the legacy docker-compose).
Usage
Dockerfile-per-app
# apps/myapp/app.toml
[app]
mode = "docker"
port = 8080 # in-container port to expose
dockerfile = "Dockerfile" # default
context = "." # default
build_args = { ENV = "dev" }
env = { LOG_LEVEL = "info" }
Pre-built image
[app]
mode = "image"
image = "ghcr.io/myorg/myapp:1.2.3"
port = 8080
env = { LOG_LEVEL = "info" }
docker-compose
[app]
mode = "compose"
compose_file = "docker-compose.yml" # default
service = "web" # which service receives HTTP
port = 8080 # service's internal port
Already-running container
[app]
mode = "docker_attached"
container = "my-running-container"
port = 8080
How it works
Each mode registers a BackendStrategy against enlace's open/closed
extension point. The strategy provides:
- a TOML field overlay so app.toml carries docker-specific config;
- a
make_asgithat proxies HTTP to the container's published host port; - a
make_lifecycle(for the supervisable modes) that shells out todocker/docker composefor start, stop, health, and log streaming.
License
Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enlace_docker-0.0.2.tar.gz.
File metadata
- Download URL: enlace_docker-0.0.2.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d180b3b90f31f1837d1af25b9bdb2f7ca300fe9f7da612a6a15ef2d9f8863c32
|
|
| MD5 |
7d5ea4afe0ab7472dc9fd02c09c93a29
|
|
| BLAKE2b-256 |
eac20a2c2a9101a731a0719b49bf2b4d7a07d31f6477fe42fbac13c8a996f558
|
File details
Details for the file enlace_docker-0.0.2-py3-none-any.whl.
File metadata
- Download URL: enlace_docker-0.0.2-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92a4b3546ea61bb7ece0b6590b3dd2d00745bf7f8416efede1c6043894ad3da6
|
|
| MD5 |
d6be45c83481d774c2062bfbbe14ed52
|
|
| BLAKE2b-256 |
c789a294e76b252a8663d45be89131f750dd4f9e0624aae27966b593d80f4d3e
|