Update README for multi-stage Docker build, add USER_AGENT env var
This commit is contained in:
@@ -1,24 +1,24 @@
|
|||||||
# DiscDrop — Quarkus multi-stage build
|
# DiscDrop — Quarkus multi-stage build
|
||||||
|
|
||||||
# ─── 1. Build ─────────────────────────────────────
|
# ─── 1. Build ─────────────────────────────────────
|
||||||
FROM maven:3-eclipse-temurin-21-alpine AS build
|
FROM maven:3-eclipse-temurin-21-alpine AS build
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY pom.xml ./
|
COPY pom.xml ./
|
||||||
RUN mvn dependency:go-offline -q 2>/dev/null || true
|
RUN mvn dependency:go-offline -q 2>/dev/null || true
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
RUN mvn package -q -DskipTests
|
RUN mvn package -q -DskipTests
|
||||||
|
|
||||||
# ─── 2. Runtime ───────────────────────────────────
|
# ─── 2. Runtime ───────────────────────────────────
|
||||||
FROM eclipse-temurin:21-jre-alpine
|
FROM eclipse-temurin:21-jre-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache sqlite
|
RUN apk add --no-cache sqlite
|
||||||
COPY --from=build /build/target/quarkus-app/ /app/
|
COPY --from=build /build/target/quarkus-app/ /app/
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
VOLUME /app/data
|
VOLUME /app/data
|
||||||
|
|
||||||
ENV DISC_DROP_DB_PATH=/app/data/discdrop.db
|
ENV DISC_DROP_DB_PATH=/app/data/discdrop.db
|
||||||
ENV DISC_DROP_CACHE_TTL=8
|
ENV DISC_DROP_CACHE_TTL=8
|
||||||
ENV DISC_DROP_BASE_URL=http://localhost:8080
|
ENV DISC_DROP_BASE_URL=http://localhost:8080
|
||||||
|
|
||||||
ENTRYPOINT ["java", "-XX:MinHeapFreeRatio=10", "-XX:MaxHeapFreeRatio=20", "-jar", "/app/quarkus-run.jar"]
|
ENTRYPOINT ["java", "-XX:MinHeapFreeRatio=10", "-XX:MaxHeapFreeRatio=20", "-jar", "/app/quarkus-run.jar"]
|
||||||
@@ -49,12 +49,11 @@ java -jar target/quarkus-app/quarkus-run.jar
|
|||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
```bash
|
Multi-stage build — no host pre-build needed, Maven runs inside the container.
|
||||||
# Build the JAR
|
|
||||||
mvn clean package
|
|
||||||
|
|
||||||
# Build the image (from project root)
|
```bash
|
||||||
docker build -f src/main/docker/Dockerfile.jvm -t discdrop .
|
# Build (from project root)
|
||||||
|
docker build -t discdrop .
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
docker run -p 8080:8080 \
|
docker run -p 8080:8080 \
|
||||||
@@ -72,10 +71,11 @@ All configuration is via environment variables:
|
|||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
|----------|---------|-------------|
|
|----------|---------|-------------|
|
||||||
| `DISC_DROP_DB_PATH` | `data/discdrop.db` | Path to the SQLite database file |
|
| `DISC_DROP_DB_PATH` | `data/discdrop.db` | Path to the SQLite database file |
|
||||||
| `DISC_DROP_CACHE_TTL` | `8` | Cache TTL in hours (how often release groups are refreshed from MusicBrainz) |
|
| `DISC_DROP_CACHE_TTL` | `8` | Cache TTL in hours |
|
||||||
| `DISC_DROP_BASE_URL` | `http://localhost:8080` | Public URL for RSS feed links |
|
| `DISC_DROP_BASE_URL` | `http://localhost:8080` | Public URL for RSS feed links |
|
||||||
|
| `DISC_DROP_USER_AGENT` | `DiscDrop/1.0 (https://gitea.t3du.com/…)` | User-Agent sent to MusicBrainz API |
|
||||||
|
|
||||||
The MusicBrainz User-Agent is set to `DiscDrop/1.0 (david.alvarez.81@gmail.com)` per [MusicBrainz API etiquette](https://musicbrainz.org/doc/MusicBrainz_API/Rate_Limiting).
|
The User-Agent header is sent with every MusicBrainz API request per [their etiquette](https://musicbrainz.org/doc/MusicBrainz_API/Rate_Limiting#Provide_meaningful_User-Agent_strings). It can be changed via `DISC_DROP_USER_AGENT`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user