Add self-contained GraalPy native executable
Build the app to a single native binary with graalpy's 'standalone native' command (Dockerfile.native). granian/rloop cannot be bundled into a standalone binary, so the executable serves the app over ASGI with Hypercorn via native/entrypoint.py, which also works around GraalPy standalone quirks (socket.listen, str response bodies, signal handling). Adds docker-compose.native.yml, a -native CI job, and README docs.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Native standalone variant of the app. Standalone file (not an override) so
|
||||
# it can be run alongside the other compose files:
|
||||
#
|
||||
# docker compose -f docker-compose.native.yml up -d --build
|
||||
#
|
||||
# The app is compiled to a single self-contained GraalPy native executable; see
|
||||
# Dockerfile.native.
|
||||
services:
|
||||
pyfconfig-native:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.native
|
||||
image: pyfconfig-native:latest
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# Public name shown in the HTML page and the curl examples; set to the
|
||||
# deployment domain (e.g. "ifconfig.example.com").
|
||||
SITE_NAME: ${SITE_NAME:-pyfconfig}
|
||||
# Comma-separated CIDRs of trusted reverse proxies (e.g.
|
||||
# "172.16.0.0/12"); required for correct client IPs when deployed
|
||||
# behind a reverse proxy. Empty means no proxy is trusted.
|
||||
TRUSTED_PROXY_CIDRS: ${TRUSTED_PROXY_CIDRS:-}
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
Reference in New Issue
Block a user