Add Docker Compose and Podman support for containerized deployment
Adds Dockerfile, docker-compose.yml, and .dockerignore to enable running ADS-Bit in a container with host networking for LAN receiver auto-scanning. Bind mounts persist config, sprites, and backgrounds across container recreation. Updates README with usage instructions. Closes #4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
.git
|
||||||
|
__pycache__
|
||||||
|
*.pyc
|
||||||
|
*.pyo
|
||||||
|
config.json
|
||||||
|
screenshots/
|
||||||
|
.claude/
|
||||||
|
CLAUDE.md
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
.DS_Store
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends gcc python3-dev && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt && \
|
||||||
|
apt-get purge -y gcc python3-dev && \
|
||||||
|
apt-get autoremove -y && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
EXPOSE 2001
|
||||||
|
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
CMD ["python3", "server.py"]
|
||||||
@@ -33,6 +33,59 @@ python3 server.py
|
|||||||
|
|
||||||
On first run, visit http://localhost:2001 and the setup wizard will guide you through configuration.
|
On first run, visit http://localhost:2001 and the setup wizard will guide you through configuration.
|
||||||
|
|
||||||
|
## Docker / Podman
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
- [Docker](https://docs.docker.com/get-docker/) with Compose V2, **or** [Podman](https://podman.io/) with `podman-compose`
|
||||||
|
|
||||||
|
### First Run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Create a config file (the setup wizard runs if you skip this)
|
||||||
|
cp config.json.example config.json
|
||||||
|
|
||||||
|
# Build and start
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
The web UI is available at http://localhost:2001.
|
||||||
|
|
||||||
|
### Useful Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# View logs
|
||||||
|
docker compose logs -f
|
||||||
|
|
||||||
|
# Stop
|
||||||
|
docker compose down
|
||||||
|
|
||||||
|
# Rebuild after a git pull
|
||||||
|
docker compose build && docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### Podman
|
||||||
|
|
||||||
|
The same `docker-compose.yml` works with Podman:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
podman-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
On SELinux systems (Fedora, RHEL), add `:Z` to each volume mount in `docker-compose.yml` so containers can access the bind-mounted files.
|
||||||
|
|
||||||
|
### Data Persistence
|
||||||
|
|
||||||
|
The following paths are bind-mounted from the repo directory and persist across container recreation:
|
||||||
|
|
||||||
|
| Path | Contents |
|
||||||
|
|------|----------|
|
||||||
|
| `config.json` | Server configuration and credentials |
|
||||||
|
| `images/` | Aircraft and UI sprites (including uploads) |
|
||||||
|
| `backgrounds/` | Theme background images (including custom themes) |
|
||||||
|
|
||||||
|
Host networking (`network_mode: host`) is used so the server can auto-scan your LAN for ADS-B receivers.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Python 3.8+
|
- Python 3.8+
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
services:
|
||||||
|
ads-bit:
|
||||||
|
build: .
|
||||||
|
container_name: ads-bit
|
||||||
|
network_mode: host
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- PYTHONUNBUFFERED=1
|
||||||
|
volumes:
|
||||||
|
# Persist config (copy config.json.example to config.json before first run)
|
||||||
|
- ./config.json:/app/config.json
|
||||||
|
# Persist custom sprite uploads
|
||||||
|
- ./images:/app/images
|
||||||
|
# Persist custom theme backgrounds
|
||||||
|
- ./backgrounds:/app/backgrounds
|
||||||
Reference in New Issue
Block a user