Gateway Deployment
Deployment (Docker Compose)
The primary deployment is two Docker containers orchestrated by Compose: an application container (Django + proxy tooling) and an nginx container (static files + reverse proxy).
Compose file location
In this repository the Compose file is:
docker/docker-compose.yml
Run Compose from the docker/ directory (or pass explicit paths) so that env_file: ./.env resolves to docker/.env.
Example:
cd docker
docker compose up -d
If your release package ships docker-compose.yml at the package root (as some package/start.sh flows expect), use that file path instead and keep .env beside it.
Services
app (gateway application)
Image name (local tag):
camera-agent-gateway:<version>(version often matchespackage/version, e.g.1.0.11, sometimes with a platform suffix in CI builds).Purpose: Runs database migrations, collects static files, ensures an API token for the admin user, runs
initialize_cameras.sh, then starts Django withrunserverbound to0.0.0.0:8000.Volumes:
static-datamounted at/vol/staticso collected static assets are shared with nginx.Environment: Loaded from
./.envnext to the Compose file.
Startup command (abbreviated) runs:
migratecollectstatic --noinputdrf_create_token admin(intended to ensure a REST token for theadminuser — ensure this management command exists in your build)initialize_cameras.sh— startsvxg-proxy-clientfor the gateway UUID and each active camera from SQLiterunserver 0.0.0.0:8000with access logs under/var/log/server/
nginx
Image name (local tag):
uplink-gateway-nginx:<version>Purpose: Serves
/static/from the shared volume and proxies/tohttp://app:8000.Ports:
80:80by default (host port 80 → container 80).Depends on:
appEnvironment:
APP_HOST=app,APP_PORT=8000,LISTEN_PORT=80(seedocker/Dockerfile.nginx).
Shared volume
static-data: Written by Django (STATIC_ROOT=/vol/static) and read by nginx for/static.
Building images
From CI / registry
GitLab CI (see .gitlab-ci.yml) builds:
Gateway image from
docker/Dockerfile(x64) ordocker/Dockerfile.arm(arm64), with BuildKit secrets for fetching the camera-agent artifact.Nginx image from
docker/Dockerfile.nginx.
Artifacts include *.img tarballs for loading with docker image load.
Local build (overview)
From the repository root, with Docker BuildKit and appropriate secrets (as required by the Dockerfile), build tags that match docker/docker-compose.yml:
# Example only — adjust tags and secrets to match your environment
docker build --secret id=gitlab_token,env=CAMERA_AGENT_ACCESS_TOKEN \
-f docker/Dockerfile -t camera-agent-gateway:latest .
docker build -f docker/Dockerfile.nginx -t uplink-gateway-nginx:latest .
Set CAMERA_AGENT_GATEWAY_VERSION in the environment or Compose to pin image tags if you do not use :latest.
Packaged deployment (optional)
The package/ directory contains scripts (start.sh, stop.sh, env_setup.sh, etc.) that:
Detect architecture (x64 / arm64).
Load pre-built
*.imgimages.Prepare
.env(see Gateway Configuration).Run
docker composeordocker-composewith project namecamera_agent_gateway.
Consult package/start.sh for the exact filenames and layout expected in a shipped zip.
Health and logs
The app Dockerfile defines a HEALTHCHECK that runs
python -m server.healthcheck(from the container workdir/code).Application stdout/stderr from
runservermay be redirected to/var/log/server/server-access.logper Compose command.Camera and gateway proxy logs are written under
/var/log/cameras/and/var/log/server/inside the app container.
Firewall and networking
Ensure TCP port 80 (or whatever you map for nginx) is reachable for UI and API clients.
initialize_cameras.shuses the default gateway IP from the container’s routing table when forwarding; production networks may need additional routing or firewall rules for cameras and cloud connectivity.
Related documentation
Gateway Configuration —
.envvariables.API Reference — HTTP API behind nginx.