Add Docker container setup (port 35811)

- Dockerfile: builds from Sources/ context, installs stegasoo + verisoo + soosef
- docker-compose.yml: single service with persistent volume at /root/.soosef
- entrypoint.sh: auto-init on first run, gunicorn with 2 workers

Build: cd soosef/docker && sudo docker compose build
Run:   sudo docker compose up -d

Port 35811, HTTPS disabled by default (reverse proxy expected)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Aaron D. Lee 2026-03-31 18:07:16 -04:00
parent 067c4073ee
commit 4f604ba7f8
3 changed files with 124 additions and 0 deletions

71
docker/Dockerfile Normal file
View File

@ -0,0 +1,71 @@
# SooSeF Docker Image
#
# Requires stegasoo and verisoo source directories alongside soosef:
# Sources/
# ├── stegasoo/
# ├── verisoo/
# └── soosef/ ← build context is parent (Sources/)
#
# Build:
# docker build -t soosef -f soosef/docker/Dockerfile .
#
# Or use docker-compose from soosef/docker/:
# docker compose up
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIP_ROOT_USER_ACTION=ignore
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
libc-dev \
libffi-dev \
libzbar0 \
libjpeg-dev \
zlib1g-dev \
curl \
openssl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# ── Install stegasoo ─────────────────────────────────────────────
COPY stegasoo/pyproject.toml stegasoo/pyproject.toml
COPY stegasoo/README.md stegasoo/README.md
COPY stegasoo/src/ stegasoo/src/
COPY stegasoo/data/ stegasoo/data/
COPY stegasoo/frontends/ stegasoo/frontends/
RUN pip install --no-cache-dir /app/stegasoo[web,dct,audio,cli]
# ── Install verisoo ──────────────────────────────────────────────
COPY verisoo/pyproject.toml verisoo/pyproject.toml
COPY verisoo/README.md verisoo/README.md
COPY verisoo/src/ verisoo/src/
RUN pip install --no-cache-dir /app/verisoo[cli]
# ── Install soosef ───────────────────────────────────────────────
COPY soosef/pyproject.toml soosef/pyproject.toml
COPY soosef/README.md soosef/README.md
COPY soosef/src/ soosef/src/
COPY soosef/frontends/ soosef/frontends/
RUN pip install --no-cache-dir /app/soosef[web,cli]
# ── Runtime setup ────────────────────────────────────────────────
RUN mkdir -p /root/.soosef
COPY soosef/docker/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
ENV SOOSEF_DATA_DIR=/root/.soosef
WORKDIR /app/soosef
EXPOSE 35811
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -fsk https://localhost:35811/ || curl -fs http://localhost:35811/ || exit 1
ENTRYPOINT ["/app/entrypoint.sh"]

27
docker/docker-compose.yml Normal file
View File

@ -0,0 +1,27 @@
services:
soosef:
build:
context: ../.. # Sources/ directory (contains stegasoo/, verisoo/, soosef/)
dockerfile: soosef/docker/Dockerfile
container_name: soosef
ports:
- "35811:35811"
environment:
SOOSEF_DATA_DIR: /root/.soosef
SOOSEF_PORT: "35811"
SOOSEF_WORKERS: "2"
SOOSEF_HTTPS_ENABLED: "${SOOSEF_HTTPS_ENABLED:-false}"
STEGASOO_CHANNEL_KEY: "${STEGASOO_CHANNEL_KEY:-}"
volumes:
- soosef-data:/root/.soosef
restart: unless-stopped
deploy:
resources:
limits:
memory: 2048M
reservations:
memory: 512M
volumes:
soosef-data:
driver: local

26
docker/entrypoint.sh Normal file
View File

@ -0,0 +1,26 @@
#!/bin/bash
set -e
# Initialize if needed (generates identity + channel key + config)
if [ ! -f "$SOOSEF_DATA_DIR/config.json" ]; then
echo "First run — initializing SooSeF..."
soosef init
echo "Initialization complete."
fi
# Determine HTTPS mode
HTTPS_FLAG=""
if [ "${SOOSEF_HTTPS_ENABLED:-true}" = "false" ]; then
HTTPS_FLAG="--no-https"
fi
echo "Starting SooSeF on port ${SOOSEF_PORT:-35811}..."
# Run with gunicorn for production
exec gunicorn \
--bind "0.0.0.0:${SOOSEF_PORT:-35811}" \
--workers "${SOOSEF_WORKERS:-2}" \
--timeout 180 \
--access-logfile - \
--error-logfile - \
"frontends.web.app:create_app()"