compose.yaml
Overview
The compose.yaml file defines a set of containerized services for a local deployment environment using Docker Compose syntax. It specifies four distinct services—proxy, proxy_outer, publisher, and client—each configured to run a specific command within the same Docker image acki-nacki-proxy-local. The file primarily facilitates running various components of a proxy system by setting environment variables, image references, and commands to execute within the containers.
Services and Their Functionality
1. proxy
Purpose: Runs the core proxy service in the local environment.
Image: acki-nacki-proxy-local — the container image containing the compiled proxy application.
Environment Variables:
RUST_LOG=info— sets the logging verbosity level to informational messages.
Command:
proxy— starts the proxy server process inside the container.
2. proxy_outer
Purpose: Runs an additional proxy service, potentially to handle external or outer network traffic, mirroring the
proxyservice setup.Image: Same as
proxy.Environment Variables: Same as
proxy.Command:
proxy— identical executable as theproxyservice.
3. publisher
Purpose: Acts as a publisher client, likely responsible for sending messages or data through the proxy service.
Image: Same as
proxy.Environment Variables: Same as
proxy.Command:
proxy_publisher --endpoint https://proxy:8080
This command runs the publisher executable targeting the proxy service at https://proxy:8080, indicating it communicates with the proxy service on port 8080 using HTTPS.
4. client
Purpose: Functions as a client to interact with the proxy service, possibly for testing or consuming published data.
Image: Same as
proxy.Environment Variables: Same as
proxy.Command:
proxy_client --endpoint https://proxy:8080
This starts the client executable targeting the proxy service endpoint, similar to the publisher service.
Implementation Details
All services use the same Docker image acki-nacki-proxy-local, which implies that the image contains multiple executables (
proxy,proxy_publisher,proxy_client) that can be invoked with different commands.The environment variable
RUST_LOG=infois uniformly applied, suggesting that the application is written in Rust and uses Rust's logging infrastructure for runtime diagnostics.The services
publisherandclientare configured to communicate through theproxyservice on port 8080 over HTTPS, indicating secure communication within the Docker network.
Interaction with Other System Components
The
compose.yamlfile acts as a local orchestrator, managing the lifecycle of proxy-related services in isolated containers.The
proxyandproxy_outerservices represent the proxy servers, which likely route or filter network traffic.The
publisherandclientservices interact with theproxyservice to send and receive data, facilitating a message publishing and consumption workflow.The endpoint https://proxy:8080 used by
publisherandclientrefers to the internal Docker service nameproxy, enabling inter-container communication via Docker's DNS resolution.This file is essential for local development, testing, or staging of the proxy system components before deployment to production.
Usage Examples
Starting all services:
docker-compose -f compose.yaml upThis command launches all defined services (
proxy,proxy_outer,publisher,client) according to the configuration.Starting a single service:
docker-compose -f compose.yaml up proxyRuns only the
proxyservice container.Logging:
TheRUST_LOG=infoenvironment variable ensures that logs from each container provide informational messages useful for monitoring service status and troubleshooting.
Visual Diagram
flowchart TD
subgraph Proxy System
proxy["proxy\n(proxy service)"]
proxy_outer["proxy_outer\n(proxy service)"]
publisher["publisher\n(proxy_publisher)"]
client["client\n(proxy_client)"]
end
publisher -->|HTTPS 8080| proxy
client -->|HTTPS 8080| proxy
This diagram illustrates the four services defined in the file and the communication flow where publisher and client interact with the proxy service over HTTPS on port 8080. The proxy_outer service operates alongside proxy but is not shown to have direct interaction with the other services in this configuration.