Repository navigation
feature: multi-stage non-root Dockerfile for Conduit backend (SQLite on /data volume) - #1153
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
…data volume Co-Authored-By: Parker Duff <pwjduff@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Note
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 2 potential issues.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| WORKDIR /app | ||
| COPY --from=build /app/app.jar app.jar | ||
| USER conduit | ||
| ENV SPRING_DATASOURCE_URL=jdbc:sqlite:/data/conduit.db |
There was a problem hiding this comment.
🟥 Default image permits forged login tokens
With the default jwt.secret, anyone who knows the repository key can sign tokens for existing user IDs. JwtTokenFilter accepts those tokens and authenticates the attacker as that user.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Valid concern, but it isn't introduced by this PR. The hardcoded jwt.secret default lives in src/main/resources/application.properties on master, and the image just inherits it. It can be overridden at runtime without code changes: Spring relaxed binding maps JWT_SECRET → jwt.secret (e.g. docker run -e JWT_SECRET=..., or an environment: entry in compose). I'm not making it mandatory here, because that would break the one-command docker compose up local stack this PR targets. I've flagged it to the requester to decide whether the image should refuse to start without a secret. Leaving this thread open.
…s on ARM64 Co-Authored-By: Parker Duff <pwjduff@gmail.com>
…s stable across base-image changes Co-Authored-By: Parker Duff <pwjduff@gmail.com>
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
Summary
Multi-stage, non-root Docker image for the Conduit Spring Boot backend. Paired frontend PR, which holds
docker-compose.ymland the nginx/apiproxy: COG-GTM/angular-realworld-example-app#82eclipse-temurin:11-jdkwith--platform=$BUILDPLATFORM,./gradlew bootJar -x test, and a Gradle cache mount.eclipse-temurin:11-jre-jammy, userconduit(uid/gid 10001).SPRING_DATASOURCE_URL=jdbc:sqlite:/data/conduit.dbandVOLUME /data.11-jre-alpineis amd64-only, and sqlite-jdbc 3.36 only ships an x86_64 Alpine native lib, so ARM64 (e.g. Apple Silicon) couldn't build or run.SQLITE_READONLY).docker/maven-mirror.init.gradle+ optionalMAVEN_MIRRORbuild arg: Maven Central rate-limits (HTTP 429) some CI/VM IPs. It does nothing when unset.Open question (Devin Review):
jwt.secretstill defaults to the value committed inapplication.properties. Override at runtime withJWT_SECRET=...(Spring relaxed binding). I didn't make it mandatory, so localdocker compose upstays one command.Test results
./gradlew test)bun run test -- --run)zone.jsmissing. Added it + 3API_URLinterceptor testsauth.hurl(8.0.1,host=http://localhost:8080)bio: ""and a placeholderimagewhere the spec expectsnull, andbio/imagecan't be set back tonullarticles.hurlPOST /articlesreturns 200 (spec says 201), and list responses includebody(newer spec leaves it out)docker compose restart→ all persisted. Issues listed belowThe hurl failures come from the Spring backend implementing an older RealWorld spec, not from the container/proxy. Every request (register, login, create, list) goes through nginx
/api→ backend and gets an application response. I didn't change backend semantics to make them pass.Visual issues on screen (pre-existing, not touched in this PR):
https://static.productionready.io/images/smiley-cyrus.jpg(set by the backend) returns 404, so nav, article meta, comments and profile show broken images.scrollWidth 420 > clientWidth 390) on home and article pages, and preview tags touch the dividers.docker compose restartAfter the acceptance run the backend runtime changed (Alpine →
11-jre-jammyfor ARM64, uid/gid pinned to 10001; see backend PR). I re-checked that image withdocker compose up -d --build: the container was recreated on the sameconduit-datavolume, the QA article, comment and favorite were still there, register returned 201, and hurl showed the same failure profile.Run it
Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/64408f2009084eb083deff72f37361bd
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/64408f2009084eb083deff72f37361bd?variant=devin
Requested by: @parkerduff
Note
Devin errored when opening this Pull Request as parkerduff.
As a fallback, Devin opened this PR as itself.
Devin Review