Current set up:
Dockerfile
FROM openjdk:17-alpine
RUN apk add bash curl
ENV BASE_DIR=/opt/basex
ENV JAVA_HOME=/usr/lib/jvm/openjdk-17
RUN mkdir -p $BASE_DIR
RUN addgroup -S basex && adduser -S -G basex basex
COPY basex-*.zip $BASE_DIR
RUN unzip $BASE_DIR/basex-*.zip -d $BASE_DIR
RUN chown -R basex:basex $BASE_DIR
COPY .basex $BASE_DIR/etc/
EXPOSE 1984
EXPOSE 80
WORKDIR $BASE_DIR
USER basex
RUN curl -L https://github.com/Schematron/schematron-basex/raw/master/dist/schematron-basex-1.2.xar -o /tmp/schematron-basex-1.2.xar &&
unzip /tmp/schematron-basex-1.2.xar -d $BASE_DIR/basex/repo/http-github.com-Schematron-schematron-basex-1.2/ &&
rm /tmp/schematron-basex-1.2.xar
CMD [“bash”, “-c”, “/opt/basex/basex/bin/basexhttp”, “‑Uadmin”]
docker run -d -p 80:80 -p 1984:1984 --name basex-container basex-image
curl -i http://localhost:80/rest/
HTTP/1.1 401 Unauthorized
Date: Sat, 27 Jul 2024 15:56:53 GMT
WWW-Authenticate: Basic realm="BaseX"
Content-Type: text/plain;charset=utf-8
Content-Length: 30
Server: Jetty(11.0.22)
Basic authentication expected.
curl -i http://admin:admin@localhost:80/rest/factbook
HTTP/1.1 401 Unauthorized
Date: Sat, 27 Jul 2024 16:19:19 GMT
WWW-Authenticate: Basic realm="BaseX"
Content-Type: text/plain;charset=utf-8
Content-Length: 21
Server: Jetty(11.0.22)
Access denied: admin.