How to easily install FlagFlow in a Docker environment
Before installing FlagFlow with Docker, ensure you have the following installed on your system:
You can install the FlagFlow system standalone in a Docker environment. Simply run the following command:
docker run -d \ --name flagflow \ -p 3000:3000 \ -e ETCD_SERVER=etcd:2379 \ -e ETCD_USERNAME=root \ -e ETCD_PASSWORD=pw_flagflow \ ghcr.io/flagflow/flagflow:1.7.0
This example connects to an etcd server at etcd:2379
. If you don't have an etcd
server running, consider using the Docker Compose setup below which includes etcd.
With Docker Compose, you can install the FlagFlow system together with etcd. Create the
following file named docker-compose.yml
:
version: '3.8' services: etcd: image: bitnami/etcd:3.6.4-debian-12-r2 container_name: flagflow-etcd environment: - ETCD_ROOT_PASSWORD=pw_flagflow volumes: - etcd-data:/bitnami/etcd # Not needed, because network allows communication between containers ports: - "2379:2379" networks: - flagflow-network # Health check is not mandatory, but recommended in production healthcheck: test: ["CMD", "etcdctl", "--user=root:pw_flagflow", "endpoint", "health"] interval: 15s timeout: 10s retries: 2 restart: on-failure flagflow: image: ghcr.io/flagflow/flagflow:1.7.0 container_name: flagflow-app depends_on: - etcd environment: - ETCD_SERVER=etcd:2379 - ETCD_USERNAME=root - ETCD_PASSWORD=pw_flagflow ports: - "3000:3000" networks: - flagflow-network # Health check is not mandatory, but recommended in production healthcheck: test: 'curl -s -I http://localhost:3000/health | head -n 1 | grep 200' interval: 15s timeout: 10s retries: 2 restart: on-failure # You can use nginx as a reverse proxy in front of FlagFlow # ... volumes: etcd-data: networks: flagflow-network: driver: bridge
Then start the services with:
docker-compose up -d
FlagFlow supports the following environment variables for configuration:
ETCD_ENDPOINTS
- Comma-separated list of etcd endpoints (default: http://localhost:2379)PORT
- Port to run the FlagFlow server on (default: 3000)LOG_LEVEL
- Log level (debug, info, warn, error) (default: info)After starting FlagFlow, you can verify that it's running correctly by:
# For standalone container docker logs flagflow # For Docker Compose docker-compose logs flagflow