mirror of
https://github.com/swapplications/uhf-server-dist.git
synced 2026-11-04 07:33:50 +00:00
docker setup
This commit is contained in:
1 parent
1c73d36153
commit
3ce9a2c6ad
4 files changed
+120
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
FROM ubuntu:25.04
|
||||
|
||||
# Avoid prompts during package installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install required dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
ffmpeg \
|
||||
unzip \
|
||||
ca-certificates \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create directory for recordings
|
||||
RUN mkdir -p /recordings
|
||||
|
||||
# Create directory for db
|
||||
RUN mkdir -p /var/lib/uhf-server
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install UHF server (modified to not use sudo)
|
||||
RUN curl -sL https://link.uhfapp.com/setup.sh > setup.sh && \
|
||||
chmod +x setup.sh && \
|
||||
sed -i 's/sudo //g' setup.sh && \
|
||||
bash setup.sh && \
|
||||
rm setup.sh
|
||||
|
||||
# Expose default port
|
||||
EXPOSE ${PORT}
|
||||
|
||||
# Set healthcheck
|
||||
HEALTHCHECK --interval=60s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:${PORT}/server/stats || exit 1
|
||||
|
||||
# Default command
|
||||
CMD ["uhf-server"]
|
||||
@@ -0,0 +1,54 @@
|
||||
# UHF Server Docker Setup
|
||||
|
||||
This directory contains Docker configuration files to easily run the UHF DVR Server.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Docker and Docker Compose installed on your system
|
||||
- Sufficient disk space for recordings
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. Clone this repository or download these files
|
||||
2. Run the server with default settings:
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
This will:
|
||||
- Build the Docker image with all dependencies
|
||||
- Start the UHF Server on port 8000
|
||||
- Store recordings in a `./recordings` directory
|
||||
|
||||
## Configuration
|
||||
|
||||
You can customize the server by setting environment variables:
|
||||
|
||||
```bash
|
||||
# Set custom port and recordings directory
|
||||
PORT=9000 RECORDINGS_DIR=/path/to/recordings docker-compose up -d
|
||||
|
||||
# Add password protection
|
||||
PORT=8000 RECORDINGS_DIR=/path/to/recordings PASSWORD=mysecretpassword docker-compose up -d
|
||||
```
|
||||
|
||||
### Available Options
|
||||
|
||||
- `PORT`: Server port (default: 8000)
|
||||
- `RECORDINGS_DIR`: Path to store recordings (default: ./recordings)
|
||||
- `PASSWORD`: Optional password protection
|
||||
|
||||
|
||||
## Logs and Troubleshooting
|
||||
|
||||
View logs:
|
||||
```bash
|
||||
docker-compose logs -f
|
||||
```
|
||||
|
||||
## Stopping the Server
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
uhf-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: uhf-server
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${PORT:-8000}:${PORT:-8000}"
|
||||
volumes:
|
||||
- ${RECORDINGS_DIR:-./recordings}:/recordings
|
||||
environment:
|
||||
- PORT=${PORT:-8000}
|
||||
- PASSWORD=${PASSWORD:-} # Optional password protection
|
||||
command: uhf-server --port ${PORT:-8000} --recordings-dir /recordings ${PASSWORD:+--password ${PASSWORD}}
|
||||
stop_grace_period: 30s
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
# UHF Server Configuration
|
||||
# Copy this file to .env and modify as needed
|
||||
|
||||
# Server port
|
||||
PORT=8000
|
||||
|
||||
# Path to recordings directory (relative or absolute)
|
||||
RECORDINGS_DIR=./recordings
|
||||
|
||||
# Optional password protection
|
||||
# PASSWORD=mysecretpassword
|
||||
Reference in new issue
Block a user