Update Dockerfile and docker-compose.yml to use port 80; add publish script for image management
This commit is contained in:
+2
-2
@@ -7,5 +7,5 @@ COPY app ./app
|
|||||||
COPY frontend ./frontend
|
COPY frontend ./frontend
|
||||||
|
|
||||||
ENV DATA_DIR=/data
|
ENV DATA_DIR=/data
|
||||||
EXPOSE 8000
|
EXPOSE 80
|
||||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
|
||||||
@@ -8,7 +8,19 @@ A self-hosted voice-note inbox for an iPhone-installed web app. Recordings are s
|
|||||||
docker compose up --build
|
docker compose up --build
|
||||||
```
|
```
|
||||||
|
|
||||||
Open `http://localhost:8000` for a desktop smoke test. For iPhone use, serve the app over HTTPS through your VPN/reverse proxy. iOS only grants microphone access in a secure context. Keep the service reachable only through your VPN and firewall; this first version has no login layer.
|
## Releases
|
||||||
|
|
||||||
|
Git tags are the source of truth for release versions. From the repository root, create a semantic version tag on the commit to release, then run the publish script:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git tag 0.0.2
|
||||||
|
docker login gitea.faerro.it
|
||||||
|
./scripts/publish-image.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
The script requires Docker and Git, and publishes both the versioned image (for example, `gitea.faerro.it/andrea/faerro-kb:0.0.2`) and `latest`. Tags may be plain versions or prefixed with `v`. Authenticate with a Gitea account or token that can publish packages before running the script.
|
||||||
|
|
||||||
|
Open `http://localhost` for a desktop smoke test. Set `HTTP_PORT` to publish the app on a different host port (for example, `HTTP_PORT=8000 docker compose up`). For iPhone use, serve the app over HTTPS through your VPN/reverse proxy. iOS only grants microphone access in a secure context. Keep the service reachable only through your VPN and firewall; this first version has no login layer.
|
||||||
|
|
||||||
In Safari on iPhone, open the HTTPS address and use **Share > Add to Home Screen**. Sign in to the VPN before opening the app if the server is only reachable there.
|
In Safari on iPhone, open the HTTPS address and use **Share > Add to Home Screen**. Sign in to the VPN before opening the app if the server is only reachable there.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
voice-kb:
|
voice-kb:
|
||||||
build: .
|
image: gitea.faerro.it/andrea/faerro-kb:0.0.1
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "${HTTP_PORT:-80}:80"
|
||||||
environment:
|
environment:
|
||||||
DATA_DIR: /data
|
DATA_DIR: /data
|
||||||
WHISPER_SERVER_URL: ${WHISPER_SERVER_URL:-}
|
WHISPER_SERVER_URL: ${WHISPER_SERVER_URL:-}
|
||||||
|
|||||||
Executable
+30
@@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
image="gitea.faerro.it/andrea/faerro-kb"
|
||||||
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
|
||||||
|
if ! command -v docker >/dev/null 2>&1; then
|
||||||
|
echo "Docker is required to build and publish the image." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v git >/dev/null 2>&1; then
|
||||||
|
echo "Git is required to determine the release version." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tag="$(git -C "$repo_root" describe --tags --exact-match HEAD 2>/dev/null || true)"
|
||||||
|
version="${tag#v}"
|
||||||
|
|
||||||
|
if [[ ! "$version" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
|
||||||
|
echo "The checked-out commit must have a SemVer tag (for example, 0.0.2 or v0.0.2)." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$repo_root"
|
||||||
|
docker build --tag "$image:$version" --tag "$image:latest" .
|
||||||
|
docker push "$image:$version"
|
||||||
|
docker push "$image:latest"
|
||||||
|
|
||||||
|
echo "Published $image:$version and $image:latest"
|
||||||
Reference in New Issue
Block a user