generated from oci/template
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 16m30s
3.9 KiB
3.9 KiB
FreeTAKServer Docker Scripts
This directory contains the scripts used by the FreeTAKServer Docker container. These scripts have been extracted from the Dockerfile for better maintainability and easier development.
Scripts Overview
install_freetak.sh
- Purpose: Installs FreeTAKServer using Ansible playbooks
- Usage: Called during Docker build process
- Environment Variables:
INSTALL_TYPE
: Installation type (latest, stable, legacy)FTS_VENV
: Path to Python virtual environmentSTABLE_FTS_VERSION
: Stable version numberLEGACY_FTS_VERSION
: Legacy version numberCFG_RPATH
: Configuration path
start_freetak.sh
- Purpose: Simple startup script for FreeTAKServer
- Usage: Basic container startup (deprecated, use entrypoint.sh)
- Environment Variables:
FTS_VENV
: Path to Python virtual environmentCFG_RPATH
: Configuration path
entrypoint.sh
- Purpose: Main entrypoint script with signal handling and logging
- Usage: Default container entrypoint
- Features:
- Graceful shutdown handling
- Proper signal forwarding
- Timestamped logging
- Dynamic configuration path detection
- Environment-based configuration
healthcheck.sh
- Purpose: Health check script for Docker container
- Usage: Called by Docker healthcheck
- Functionality: Checks if FreeTAKServer process is running
dev-helper.sh
- Purpose: Development helper script for validation and testing
- Usage:
./scripts/dev-helper.sh [validate|test|info|help]
- Features:
- Script validation
- Syntax checking
- Information display
- Development workflow support
Development Workflow
-
Validate Scripts: Ensure all scripts exist and are executable
./scripts/dev-helper.sh validate
-
Test Syntax: Check all scripts for syntax errors
./scripts/dev-helper.sh test
-
View Information: Display script information
./scripts/dev-helper.sh info
Script Maintenance
Adding New Scripts
- Create the script in the
scripts/
directory - Make it executable:
chmod +x scripts/your-script.sh
- Add it to the Dockerfile
COPY
instruction - Update the
dev-helper.sh
script to include validation
Modifying Existing Scripts
- Edit the script file directly
- Test syntax:
./scripts/dev-helper.sh test
- Rebuild the Docker image to apply changes
Best Practices
- Always include proper error handling (
set -e
) - Use descriptive variable names
- Add comments for complex logic
- Follow consistent formatting
- Test scripts before committing
Environment Variables
The scripts use these key environment variables:
FTS_VENV
: Python virtual environment path (default:/opt/fts.venv
)INSTALL_TYPE
: Installation type -latest
,stable
, orlegacy
CFG_RPATH
: Configuration path (auto-detected based on install type)STABLE_FTS_VERSION
: Stable version numberLEGACY_FTS_VERSION
: Legacy version number
Troubleshooting
Script Not Executable
chmod +x scripts/script-name.sh
Syntax Errors
bash -n scripts/script-name.sh
Testing Individual Scripts
# Test in container context
docker run --rm -it freetak-server /bin/bash
# Then run: /opt/script-name.sh
Debugging
Add set -x
at the beginning of scripts to enable debug output.
Integration with Dockerfile
The scripts are copied into the container during build:
# Copy the scripts
COPY scripts/install_freetak.sh /opt/install_freetak.sh
COPY scripts/start_freetak.sh /opt/start_freetak.sh
COPY scripts/healthcheck.sh /opt/healthcheck.sh
COPY scripts/entrypoint.sh /opt/entrypoint.sh
# Make the scripts executable
RUN chmod +x /opt/*.sh
License
These scripts are part of the FreeTAKServer Docker container project and follow the same licensing as the original FreeTAKHub-Installation project (Eclipse Public License 2.0).