1st commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# ---- Stage 1: compile libultrahdr (ultrahdr_app) --------------------------
|
||||
FROM alpine:3.21 AS uhdr-build
|
||||
|
||||
RUN apk add --no-cache \
|
||||
git cmake make g++ nasm pkgconf libjpeg-turbo-dev
|
||||
|
||||
WORKDIR /build
|
||||
# Pin to a commit once you've confirmed it works for you — HEAD can move.
|
||||
RUN git clone --depth 1 https://github.com/google/libultrahdr.git
|
||||
|
||||
RUN cmake -G "Unix Makefiles" -DUHDR_WRITE_XMP=ON \
|
||||
-S libultrahdr -B libultrahdr/build \
|
||||
&& cmake --build libultrahdr/build -j"$(nproc)"
|
||||
|
||||
# ---- Stage 2: runtime -------------------------------------------------------
|
||||
FROM python:3.11-alpine
|
||||
|
||||
RUN apk add --no-cache exiftool libjpeg-turbo libstdc++
|
||||
|
||||
COPY --from=uhdr-build /build/libultrahdr/build/ultrahdr_app /usr/local/bin/ultrahdr_app
|
||||
RUN chmod +x /usr/local/bin/ultrahdr_app
|
||||
|
||||
WORKDIR /app
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY main.py .
|
||||
COPY app/ app/
|
||||
COPY templates/ templates/
|
||||
COPY static/ static/
|
||||
COPY LICENSE VERSION ./
|
||||
COPY docker/entrypoint.sh /app/entrypoint.sh
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
|
||||
RUN adduser -D runner && mkdir -p /app/jobs && chown -R runner:runner /app
|
||||
USER runner
|
||||
|
||||
EXPOSE 5000
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
@@ -0,0 +1,5 @@
|
||||
jobs/*
|
||||
!jobs/.gitkeep
|
||||
__pycache__/
|
||||
*.pyc
|
||||
.git
|
||||
@@ -0,0 +1,15 @@
|
||||
name: instagram-hdr
|
||||
|
||||
services:
|
||||
hdr-web:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile
|
||||
container_name: instagram-hdr-web
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5050:5000" # host:container — change 5050 if that's taken too
|
||||
# Put a reverse proxy (Traefik/nginx/SWAG) in front of this if you
|
||||
# want it reachable outside your LAN — the Flask app itself has no
|
||||
# auth and no rate limiting, so keep it internal-only or add both
|
||||
# before exposing it further than your own network.
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
CYAN="\033[1;36m"
|
||||
NC="\033[0m"
|
||||
|
||||
VERSION=$(cat /app/VERSION)
|
||||
|
||||
echo -e "${CYAN}╭──────────────────────────────────────────────────╮${NC}"
|
||||
echo -e "${CYAN}│${NC} Instagram ${CYAN}HDR${NC} Assembler — version ${VERSION} ${CYAN}│${NC}"
|
||||
echo -e "${CYAN}├──────────────────────────────────────────────────┤${NC}"
|
||||
echo -e "${CYAN}│${NC} License: MIT (see LICENSE) ${CYAN}│${NC}"
|
||||
echo -e "${CYAN}│${NC} Gain-map pipeline adapted from: ${CYAN}│${NC}"
|
||||
echo -e "${CYAN}│${NC} kostis-kounadis/instagram-hdr-assembler ${CYAN}│${NC}"
|
||||
echo -e "${CYAN}╰──────────────────────────────────────────────────╯${NC}"
|
||||
|
||||
echo -e "[~] Checking required external tools..."
|
||||
missing=""
|
||||
for tool in ultrahdr_app exiftool; do
|
||||
if ! command -v "$tool" >/dev/null 2>&1; then
|
||||
missing="$missing $tool"
|
||||
fi
|
||||
done
|
||||
if [ -n "$missing" ]; then
|
||||
echo -e "[!] Missing required tools:$missing"
|
||||
exit 1
|
||||
fi
|
||||
echo -e "[✓] Required tools found: ultrahdr_app, exiftool"
|
||||
|
||||
echo -e "[~] Starting Instagram HDR Assembler web server..."
|
||||
exec gunicorn --bind 0.0.0.0:5000 --workers 1 --threads 4 --timeout 120 main:app
|
||||
Reference in New Issue
Block a user