Skip to main content

Environment variables

Joystick IoT platform uses environment variables to configure services. You can set these in a .env file in the root directory or export them in your shell.

Global settings

VariableDescriptionDefaultRequired
HOSTHostname for Traefik routinglocalhostNo

Joystick API

The main API service that handles device control and communication.
VariableDescriptionDefaultRequired
STREAM_API_URLMediaMTX API endpointhttp://host.docker.internal:9997Yes
POCKETBASE_URLPocketBase database URLhttp://pocketbase:8090Yes
SWITCHER_API_URLSwitcher service URLhttp://switcher:8080Yes
PORTAPI server port8000No
HOSTAPI server host0.0.0.0No
JOYSTICK_API_KEYAPI key for service authenticationdev-api-key-12345Yes (production)

PocketBase

Database and authentication service.
VariableDescriptionDefaultRequired
BAKER_URLBaker service URLhttp://baker:3000Yes
MEDIAMTX_APIMediaMTX API endpointhttp://host.docker.internal:9997Yes
JOYSTICK_API_URLJoystick API URLhttp://joystick:8000Yes
JOYSTICK_API_KEYAPI key to authenticate with Joystickdev-api-key-12345Yes

Panel UI

Web-based control panel interface.
VariableDescriptionDefaultRequired
POCKETBASE_URLPocketBase database URLhttp://pocketbase:8090Yes
PORTPanel server port4000No

Baker

Video processing and streaming service.
VariableDescriptionDefaultRequired
PORTBaker server port3000No
STREAM_API_URLMediaMTX API endpointhttp://host.docker.internal:9997Yes
POCKETBASE_URLPocketBase database URLhttp://pocketbase:8090Yes
JOYSTICK_API_URLJoystick API URLhttp://joystick:8000Yes

Switcher

Stream switching and health monitoring service.
VariableDescriptionDefaultRequired
STREAM_API_URLMediaMTX API endpointhttp://host.docker.internal:9997Yes
POCKETBASE_URLPocketBase database URLhttp://pocketbase:8090Yes
JOYSTICK_API_URLJoystick API URLhttp://joystick:8000Yes
JOYSTICK_API_KEYAPI key to authenticate with Joystickdev-api-key-12345Yes
SLOT_HEALTH_CHECK_INTERVALHealth check interval in seconds30No
PORTSwitcher server port8080No

Whisper

Audio processing and communication service.
VariableDescriptionDefaultRequired
STREAM_API_URLMediaMTX API endpointhttp://host.docker.internal:9997Yes
POCKETBASE_URLPocketBase database URLhttp://pocketbase:8090Yes
JOYSTICK_API_URLJoystick API URLhttp://joystick:8000Yes
PORTWhisper server port8081No

Studio

Production control interface.
VariableDescriptionDefaultRequired
POCKETBASE_URLPocketBase database URLhttp://pocketbase:8090Yes
JOYSTICK_API_URLJoystick API URLhttp://joystick:8000Yes
PORTStudio server port8001No

Example configuration

Create a .env file in your project root:
# Global settings
HOST=joystick.example.com

# Security (change these in production!)
JOYSTICK_API_KEY=your-secure-api-key-here

Service dependencies

Services have the following dependencies:
  • PocketBase: Core database, must start first
  • MediaMTX: Video streaming server, required by most services
  • Joystick API: Depends on PocketBase and MediaMTX
  • Panel, Baker, Switcher, Whisper, Studio: All depend on PocketBase and MediaMTX

Docker networking

Standard deployment (docker-compose.yml)

Uses a bridge network (app-network) with service name resolution. Services communicate using internal service names:
networks:
  app-network:
    driver: bridge
Services reference each other by service name (e.g., http://pocketbase:8090).

Linux deployment (docker-compose.linux.yml)

Uses host networking for better performance:
network_mode: host
All services bind directly to the host network interface.

Development deployment (docker-compose.dev.yml)

Uses bridge networking with exposed ports for debugging:
ports:
  - "8090:8090"  # PocketBase
  - "9997:9997"  # MediaMTX API
  - "8554:8554"  # RTSP

Logging configuration

All services use JSON file logging with rotation:
logging:
  driver: "json-file"
  options:
    max-size: "10m"
    max-file: "3"
This configuration:
  • Limits log files to 10MB each
  • Keeps up to 3 rotated log files per container
  • Uses JSON format for structured logging
See monitoring for log viewing options.

Volume mounts

Persistent data

PocketBase data is stored in a Docker volume:
volumes:
  pb_data:

Configuration files

MediaMTX configuration is mounted from the host:
volumes:
  - ./mediamtx/mediamtx.yml:/mediamtx.yml

Development volumes

In development mode, additional volumes are mounted:
volumes:
  - ./pocketbase/pb_data:/pb_data
  - ./pocketbase/pb_public:/pb_public
  - ./pocketbase/pb_hooks:/pb_hooks
  - ./pocketbase/pb_migrations:/pb_migrations

Build docs developers (and LLMs) love