hako/e2e/Dockerfile.e2e
Felipe M. f47010cd0f
Some checks failed
CI / goreleaser-lint (pull_request) Successful in 11s
CI / format (pull_request) Successful in 2m38s
CI / test (pull_request) Successful in 5m0s
CI / lint (pull_request) Successful in 3m5s
CI / build (pull_request) Successful in 3m16s
CI / e2e (pull_request) Failing after 28m15s
fix(e2e): make link creation reach test web server via shared network
The test web server and Hako container previously ran on isolated Docker
networks, so Hako could not fetch URLs like http://localhost:32865 (the
host-mapped port) from inside its container. Most tests passed vacuously
because they only checked DOM containers; the Archive tests failed
because they tried to click an actual link item that was never created.

Changes:
- Add a shared Docker network so both containers can communicate by alias
- Test web server registers as hako-testserver and returns that as its URL
- Hako container joins the same network and can resolve the alias
- CreateLink now navigates to /home before each call so it can be invoked
  multiple times in a row (the form redirects to /links after submission)
- IsVisible uses .First() to avoid Playwright strict-mode errors when a
  selector matches multiple elements
- Archive tests use .link-item instead of the never-matching
  a[href*='/links/'] selector
- Bump Dockerfile.e2e Alpine to 3.23 to match the production Containerfile
2026-04-08 16:42:42 +02:00

19 lines
466 B
Text

FROM alpine:3.23
RUN apk add --no-cache poppler-utils ca-certificates tzdata && \
addgroup -g 1000 hako && \
adduser -D -u 1000 -G hako hako
WORKDIR /app
COPY hako /usr/local/bin/hako
COPY config.e2e.yaml /app/config/config.yaml
RUN chmod +x /usr/local/bin/hako && \
mkdir -p /app/data /app/data/archives && \
chown -R hako:hako /app
USER hako
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/hako"]
CMD ["server", "--config", "/app/config/config.yaml"]