# FreeTAKServer Docker Container This Docker container provides a complete FreeTAKServer installation based on the official FreeTAKTeam installation script. It includes all necessary components and dependencies to run FreeTAKServer in a containerized environment. ## Features - **All-in-one container**: Includes FreeTAKServer, Web UI, and Web Map - **Multiple installation types**: Support for latest, stable, and legacy versions - **Automated setup**: Based on the official FreeTAKHub-Installation scripts - **Health checks**: Built-in container health monitoring - **Persistent data**: Volume support for configuration and data persistence ## Quick Start ### Using Docker Compose (Recommended) ```bash # Clone or navigate to the directory containing docker-compose.yml docker-compose up -d ``` ### Using the Run Script ```bash # Build and run with latest version (default) ./run.sh # Build and run with stable version ./run.sh stable # Build and run with legacy version ./run.sh legacy ``` ### Manual Docker Commands ```bash # Build the image docker build -t freetak-server . # Run the container docker run -d \ --name freetak-server \ -p 8087:8087 \ -p 8080:8080 \ -p 8443:8443 \ -p 19023:19023 \ -e INSTALL_TYPE=latest \ freetak-server ``` ## Installation Types The container supports three installation types via the `INSTALL_TYPE` environment variable: - **`latest`** (default): Installs the most recent version from PyPI - **`stable`**: Installs the stable version (v2.0.66) - **`legacy`**: Installs the legacy version (v1.9.9.6) with Python 3.8 ## Exposed Ports - **8087**: Main FreeTAKServer port - **8080**: Web UI port - **8443**: HTTPS port (if configured) - **19023**: FTS API port ## Access Points After the container is running, you can access: - **Web UI**: http://localhost:8080 - **Main API**: http://localhost:8087 - **API Endpoint**: http://localhost:19023 ## Project Structure ``` /docker/services/freetak/ ├── Dockerfile # Main container definition ├── docker-compose.yml # Docker Compose configuration ├── run.sh # Quick start script ├── scripts/ # Container scripts directory │ ├── install_freetak.sh # Installation script │ ├── start_freetak.sh # Simple startup script │ ├── entrypoint.sh # Main entrypoint with signal handling │ ├── healthcheck.sh # Health check script │ ├── dev-helper.sh # Development helper script │ └── README.md # Scripts documentation └── README.md # This file ``` ## Configuration The container includes: - Python virtual environment at `/opt/fts.venv` - FreeTAKHub-Installation repository at `/opt/FreeTAKHub-Installation` - Configuration files based on the installation type - Ansible playbooks for automated setup ## Environment Variables - `INSTALL_TYPE`: Installation type (latest, stable, legacy) - `TZ`: Timezone (default: UTC) - `DEBIAN_FRONTEND`: Set to noninteractive for automated installation - `PY3_VER`: Python version (automatically set based on install type) - `FTS_VENV`: Virtual environment path - `CFG_RPATH`: Configuration path (automatically set based on install type) ## Volumes To persist data and configuration: ```yaml volumes: - freetak_data:/opt/freetak/data - freetak_config:/opt/FreeTAKHub-Installation ``` ## Health Checks The container includes a built-in health check that monitors the FreeTAKServer process: ```bash # Check container health docker ps # Look for "healthy" status ``` ## Troubleshooting ### View Logs ```bash docker logs freetak-server ``` ### Access Container Shell ```bash docker exec -it freetak-server /bin/bash ``` ### Check Service Status ```bash docker exec -it freetak-server /opt/healthcheck.sh ``` ### Restart Container ```bash docker restart freetak-server ``` ## Building from Source The Dockerfile is based on Ubuntu 22.04 and includes: 1. System dependencies (Python, Ansible, Git, etc.) 2. Python virtual environment setup 3. FreeTAKHub-Installation repository clone 4. Ansible playbook execution 5. Service configuration and startup scripts ## Security Notes - The container runs as a non-root user (`freetak`) - SSH keys are generated for internal use - All dependencies are installed from official repositories - The installation follows the official FreeTAKTeam procedures ## License This Docker container is based on the FreeTAKHub-Installation scripts, which are licensed under the Eclipse Public License 2.0 (EPL-2.0). ## Support For issues related to FreeTAKServer itself, please refer to the [FreeTAKTeam GitHub repository](https://github.com/FreeTAKTeam/FreeTAKServer). For Docker-specific issues, please check the container logs and ensure all required ports are available.