Skip to content

feature: containerize Conduit frontend + docker compose stack (nginx /api proxy, configurable API URL) - #82

Closed
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1791828646-containerize
Closed

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1791828646-containerize

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Summary

Containerizes the Conduit Angular frontend and adds the whole-stack docker-compose.yml. Paired backend PR: COG-GTM/spring-boot-realworld-example-app#1153 (compose builds it from the sibling checkout).

  • Configurable API URL: the interceptor no longer hardcodes https://api.realworld.show/api. It reads an API_URL injection token that defaults to environment.apiUrl.
    • environment.ts keeps the public demo API, so bun run start and the e2e suite behave as before.
    • New docker build configuration swaps in environment.docker.ts (apiUrl: '/api', same-origin).
  • Dockerfile: Bun/Node build stage, then nginxinc/nginx-unprivileged:1.27-alpine runtime (non-root, ~74 MB).
  • nginx (docker/nginx.conf.template):
    • /api/foo → rewrite → ${BACKEND_URL}/foo, because the backend has no /api prefix.
    • SPA try_files fallback.
    • resolver 127.0.0.11 with a variable proxy_pass, so a recreated backend container (new IP) doesn't 502.
  • Compose:
    • Only the frontend is published (${CONDUIT_PORT:-8080}).
    • The backend is internal, with a wget /tags healthcheck gating frontend start.
    • SQLite lives on the named volume conduit-data at /data/conduit.db.
  • Test harness: added zone.js (devDependency). All 6 specs import it but it wasn't installed, so Vitest loaded 0 files on master.

CI test (Playwright e2e against the public api.realworld.show) fails on the same 6 settings.spec.ts tests (PUT /user → 422 from the public API) as on #81. It doesn't depend on this change, because the default environment is unchanged.

Test results

Layer Result Notes
Backend unit (./gradlew test) ✅ 68 / 68 pass no backend Java changed
Frontend unit (bun run test -- --run) ✅ 183 / 183 pass (7 files) was 0 files loading on master: zone.js missing. Added it + 3 API_URL interceptor tests
hurl auth.hurl (8.0.1, host=http://localhost:8080) ❌ fail spec drift: backend returns bio: "" and a placeholder image where the spec expects null, and bio/image can't be set back to null
hurl articles.hurl ❌ fail spec drift: POST /articles returns 200 (spec says 201), and list responses include body (newer spec leaves it out)
Computer-use acceptance (recorded) ✅ flow pass · ⚠️ 2 visual issues register → markdown article w/ 2 tags → renders → comment → favorite → logout/login → docker compose restart → all persisted. Issues listed below

The 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):

  • Default avatar https://static.productionready.io/images/smiley-cyrus.jpg (set by the backend) returns 404, so nav, article meta, comments and profile show broken images.
  • At 390px, signed-in nav overflows (scrollWidth 420 > clientWidth 390) on home and article pages, and preview tags touch the dividers.

Acceptance run (annotated, sped up)

Markdown + 2 tags rendered After docker compose restart Favorite persisted 390px

After the acceptance run the backend runtime changed (Alpine → 11-jre-jammy for ARM64, uid/gid pinned to 10001; see backend PR). I re-checked that image with docker compose up -d --build: the container was recreated on the same conduit-data volume, the QA article, comment and favorite were still there, register returned 201, and hurl showed the same failure profile.

Run it

# sibling checkouts: ./angular-realworld-example-app and ./spring-boot-realworld-example-app
cd angular-realworld-example-app
git submodule update --init
docker compose up -d --build        # → http://localhost:8080
# optional: CONDUIT_PORT=9000, BACKEND_CONTEXT=/path/to/backend,
#           MAVEN_MIRROR=https://maven-central.storage-download.googleapis.com/maven2 (if Maven Central rate-limits you)
hurl --test --variable host=http://localhost:8080 --variable uid=$RANDOM realworld/specs/api/hurl/{auth,articles}.hurl

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

Status Commit
⚪ Not started —

Run Devin Review

Devin Review (Staging)


Devin Review

…L, compose stack) and fix vitest harness (zone.js)

Co-Authored-By: Parker Duff <pwjduff@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread docker/nginx.conf.template Resolved
…s keep working

Co-Authored-By: Parker Duff <pwjduff@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

Recorded Chrome acceptance pass against the compose stack: the flow passes (register, markdown article with 2 tags, comment, favorite 0→1, logout/login, docker compose restart, then article, comment and favorite all persisted). All API calls went through localhost:8080/api.

Visual issues (pre-existing):

  • the backend's default avatar URL returns 404
  • signed-in nav overflows at 390px (420px scrollWidth)

Acceptance run

After restart: article + comment After restart: Favorited Posts 390px article

Written by Devin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants