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
|
||||
|
||||
# ─── 1. Build ─────────────────────────────────────
|
||||
FROM maven:3-eclipse-temurin-21-alpine AS build
|
||||
WORKDIR /build
|
||||
COPY pom.xml ./
|
||||
RUN mvn dependency:go-offline -q 2>/dev/null || true
|
||||
COPY src ./src
|
||||
RUN mvn package -q -DskipTests
|
||||
|
||||
# ─── 2. Runtime ───────────────────────────────────
|
||||
FROM eclipse-temurin:21-jre-alpine
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache sqlite
|
||||
COPY --from=build /build/target/quarkus-app/ /app/
|
||||
EXPOSE 8080
|
||||
|
||||
VOLUME /app/data
|
||||
|
||||
ENV DISC_DROP_DB_PATH=/app/data/discdrop.db
|
||||
ENV DISC_DROP_CACHE_TTL=8
|
||||
ENV DISC_DROP_BASE_URL=http://localhost:8080
|
||||
|
||||
ENTRYPOINT ["java", "-XX:MinHeapFreeRatio=10", "-XX:MaxHeapFreeRatio=20", "-jar", "/app/quarkus-run.jar"]
|
||||
# DiscDrop — Quarkus multi-stage build
|
||||
|
||||
# ─── 1. Build ─────────────────────────────────────
|
||||
FROM maven:3-eclipse-temurin-21-alpine AS build
|
||||
WORKDIR /build
|
||||
COPY pom.xml ./
|
||||
RUN mvn dependency:go-offline -q 2>/dev/null || true
|
||||
COPY src ./src
|
||||
RUN mvn package -q -DskipTests
|
||||
|
||||
# ─── 2. Runtime ───────────────────────────────────
|
||||
FROM eclipse-temurin:21-jre-alpine
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache sqlite
|
||||
COPY --from=build /build/target/quarkus-app/ /app/
|
||||
EXPOSE 8080
|
||||
|
||||
VOLUME /app/data
|
||||
|
||||
ENV DISC_DROP_DB_PATH=/app/data/discdrop.db
|
||||
ENV DISC_DROP_CACHE_TTL=8
|
||||
ENV DISC_DROP_BASE_URL=http://localhost:8080
|
||||
|
||||
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
|
||||
|
||||
```bash
|
||||
# Build the JAR
|
||||
mvn clean package
|
||||
Multi-stage build — no host pre-build needed, Maven runs inside the container.
|
||||
|
||||
# Build the image (from project root)
|
||||
docker build -f src/main/docker/Dockerfile.jvm -t discdrop .
|
||||
```bash
|
||||
# Build (from project root)
|
||||
docker build -t discdrop .
|
||||
|
||||
# Run
|
||||
docker run -p 8080:8080 \
|
||||
@@ -72,10 +71,11 @@ All configuration is via environment variables:
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `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_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