Files
brencher/Dockerfile_test_app
admin 2a14d70fab playwright tests. refactor backend (#79)
* refactor backend
* Playwright test
2026-05-10 20:14:50 +02:00

32 lines
1.1 KiB
Plaintext

FROM nginx:1.27-alpine
COPY .git /tmp/repo/.git
# Configure nginx to listen on 5001 to match container port expectations.
RUN sed -i 's/listen 80;/listen 5001;/' /etc/nginx/conf.d/default.conf
# Build a custom landing page directly in the image and inject git revision.
RUN set -eux; \
apk add --no-cache --virtual .git-deps git; \
GIT_REVISION="$(git --git-dir=/tmp/repo/.git rev-parse --short HEAD 2>/dev/null || echo unknown)"; \
{ \
echo '<!doctype html>'; \
echo '<html lang="en">'; \
echo '<head>'; \
echo ' <meta charset="utf-8">'; \
echo ' <meta name="viewport" content="width=device-width, initial-scale=1">'; \
echo ' <title>Brencher Test App</title>'; \
echo '</head>'; \
echo '<body>'; \
echo ' <h1>Nginx Is Running</h1>'; \
echo ' <p>Custom landing page for the Brencher test app container.</p>'; \
echo ' <p>Port: 5001</p>'; \
echo " <p>Git revision: ${GIT_REVISION}</p>"; \
echo '</body>'; \
echo '</html>'; \
} > /usr/share/nginx/html/index.html; \
rm -rf /tmp/repo/.git; \
apk del .git-deps
EXPOSE 5001