generated from oci/template
it builds, but does it run?
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 16m30s
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 16m30s
This commit is contained in:
parent
d93ecd2627
commit
bfc790355a
10 changed files with 801 additions and 23 deletions
189
Readme.md
189
Readme.md
|
@ -1,36 +1,181 @@
|
|||
# README for Docker Image Build and Publish Workflows
|
||||
# FreeTAKServer Docker Container
|
||||
|
||||
## Overview
|
||||
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.
|
||||
|
||||
This repository contains two GitHub Actions workflows that automate the building and publishing of Docker images to an OCI registry.
|
||||
## Features
|
||||
|
||||
### Workflows
|
||||
- **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
|
||||
|
||||
1. **On Commit to Main**
|
||||
- **Trigger:** Activates on commits to the `main` branch (tags are excluded).
|
||||
- **Purpose:** Builds and publishes a Docker image for each commit.
|
||||
## Quick Start
|
||||
|
||||
2. **On Tag Push**
|
||||
- **Trigger:** Activates when a new tag is pushed.
|
||||
- **Purpose:** Builds and publishes a Docker image for the tag and tags it as `latest`.
|
||||
### Using Docker Compose (Recommended)
|
||||
|
||||
## Prerequisites
|
||||
```bash
|
||||
# Clone or navigate to the directory containing docker-compose.yml
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
- **Secrets Needed:**
|
||||
- `OCI_TOKEN`: Your OCI registry token.
|
||||
- `OCI_USER`: Your OCI registry username.
|
||||
### Using the Run Script
|
||||
|
||||
## How to Use
|
||||
```bash
|
||||
# Build and run with latest version (default)
|
||||
./run.sh
|
||||
|
||||
1. **Clone the Repository:** Get a local copy of this repository.
|
||||
2. **Modify Dockerfile:** Update the `Dockerfile` for your application.
|
||||
3. **Push Changes:** Push changes to the `main` branch or create a new tag.
|
||||
4. **Check Workflow Status:** View the Actions tab in Forgjo to monitor workflow runs.
|
||||
# Build and run with stable version
|
||||
./run.sh stable
|
||||
|
||||
## Notes
|
||||
# Build and run with legacy version
|
||||
./run.sh legacy
|
||||
```
|
||||
|
||||
- Ensure your Docker environment is compatible with multi-platform builds if necessary.
|
||||
### 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 project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
||||
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.
|
Loading…
Add table
Add a link
Reference in a new issue