Stork login page returns 404 on new Docker install, no errors
Hello,
I am attempting to run Stork in a Docker environment, but the index and login pages return 404:
$ docker logs stork-server
...
INFO[2022-08-17 18:27:54] middleware.go:79 HTTP request incoming method="GET" path="/" remote="10.0.7.1:39416"
INFO[2022-08-17 18:27:54] middleware.go:93 HTTP request served method="GET" path="/" remote="10.0.7.1:39416" size="19" status="404" text_status="Not Found" took="168.256µs"
INFO[2022-08-17 18:27:58] middleware.go:79 HTTP request incoming method="GET" path="/login" remote="10.0.7.1:39416"
INFO[2022-08-17 18:27:58] middleware.go:93 HTTP request served method="GET" path="/login" remote="10.0.7.1:39416" size="19" status="404" text_status="Not Found" took="102.908µs"
I am running PostgreSQL 14 in Docker, as so:
$ docker run --rm -dit --network host -ePOSTGRES_USER=stork -ePOSTGRES_PASSWORD='omitted' -ePOSTGRES_DB=stork -p 5432:5432/tcp --name stork-db postgresql
Then, running Stork using this Dockerfile:
FROM ubuntu # Ubuntu 22.04, not supported but should still work
ENV STORK_UID=375
ENV STORK_GID=375
RUN apt update && \
apt install -y curl
RUN curl -1sLf 'https://dl.cloudsmith.io/public/isc/stork/cfg/setup/bash.deb.sh' | bash && \
apt install -y isc-stork-server
RUN groupadd --gid $STORK_GID --system stork && \
useradd --gid $STORK_GID --uid $STORK_UID --system --no-create-home stork
COPY start.sh /start.sh
RUN chmod +x /start.sh && \
chown stork:stork /start.sh
USER stork
ENTRYPOINT ["bash", "-c", "/start.sh"]
Where start.sh
simply creates the DB, upgrades it, and starts the Stork server:
#!/usr/bin/env bash
echo 'Running db-init..'
/usr/bin/stork-tool db-init -u "$STORK_DATABASE_USER_NAME" -d "$STORK_DATABASE"
echo 'Performing DB upgrade(s) if applicable..'
/usr/bin/stork-tool db-up -u "$STORK_DATABASE_USER_NAME" -d "$STORK_DATABASE"
echo 'Starting the Stork server..'
/usr/bin/stork-server
... run using the command:
$ docker run --rm -dit --network host -eSTORK_DATABASE_USER_NAME=stork -eSTORK_DATABASE_HOST=127.0.0.1 -eSTORK_DATABASE_PASSWORD='omitted' -eSTORK_DATABASE=stork stork-server
The only page I can get to load with a 200 is /swagger.json
. By extracting the .deb from Cloudsmith, I found the frontend files at /usr/share/stork/www
, but they are all readable by the stork
user I create; for the avoidance of doubt, I added a line to the Dockerfile to recursively set ownership of that directory to the stork user, but the issue was not resolved.