Podman / Docker Deployment
Mezite provides container images and a Compose file for deploying the full stack with Podman or Docker.
Building the Container Image
The repository includes a Containerfile that produces a minimal
image containing all Mezite binaries.
Containerfile (excerpt) dockerfile
FROM golang:1.26 AS builder
WORKDIR /src
COPY . .
RUN make build
FROM alpine:3.19
COPY --from=builder /src/bin/ /usr/local/bin/
EXPOSE 3025 3080 3023 3024
ENTRYPOINT ["mezhub"] Build the image bash
podman build -t mezite:latest . Compose Deployment
Use podman-compose.yml to run the full stack: PostgreSQL, mezhub,
and a mezd.
podman-compose.yml (excerpt) yaml
version: "3"
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: mezite
POSTGRES_PASSWORD: mezite
POSTGRES_DB: mezite
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
mezhub:
image: mezite:latest
depends_on:
- postgres
environment:
MEZITE_DATA_DIR: /var/lib/mezite
MEZITE_AUTH_LISTEN_ADDR: 0.0.0.0:3025
MEZITE_PROXY_LISTEN_ADDR: 0.0.0.0:3080
MEZITE_DB_HOST: postgres
MEZITE_DB_PORT: 5432
MEZITE_DB_USER: mezite
MEZITE_DB_PASSWORD: mezite
MEZITE_DB_NAME: mezite
MEZITE_DB_SSLMODE: disable
ports:
- "3025:3025"
- "3080:3080"
- "3023:3023"
- "3024:3024"
volumes:
pgdata: Start with Compose bash
podman-compose up -d Running with podman run
Run mezhub directly bash
podman run -d --name mezhub \
-e MEZITE_DB_HOST=host -e MEZITE_DB_PORT=5432 \
-e MEZITE_DB_USER=mezite -e MEZITE_DB_PASSWORD=mezite \
-e MEZITE_DB_NAME=mezite -e MEZITE_DB_SSLMODE=disable \
-p 3025:3025 -p 3080:3080 -p 3023:3023 -p 3024:3024 \
mezite:latest Environment Variables
| Variable | Description | Default |
|---|---|---|
MEZITE_DATA_DIR | Data directory for state and certs | /var/lib/mezite |
MEZITE_AUTH_LISTEN_ADDR | Auth gRPC listen address | 0.0.0.0:3025 |
MEZITE_PROXY_LISTEN_ADDR | Proxy HTTPS listen address | 0.0.0.0:3080 |
MEZITE_DB_HOST | PostgreSQL host | localhost |
MEZITE_DB_PORT | PostgreSQL port | 5432 |
MEZITE_DB_USER | PostgreSQL user | (required) |
MEZITE_DB_PASSWORD | PostgreSQL password | (required) |
MEZITE_DB_NAME | PostgreSQL database name | (required) |
MEZITE_DB_SSLMODE | PostgreSQL SSL mode | require |
MEZITE_LOG_LEVEL | Log level (debug, info, warn, error) | info |
Health Checks
The mezhub binary exposes a health endpoint at /healthz on the proxy port. Use it for container health checks:
Health check in Compose yaml
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3080/healthz"]
interval: 10s
timeout: 5s
retries: 3