Jump to navigation Jump to search
120 bytes added ,  14:58, 27 February 2020
no edit summary
--publish 8984:8984 \
--volume "$(pwd)/basex/data":/srv/basex/data \
By passing any other BaseX executable, you can also for example run a BaseX client connecting to the linked BaseX server for management operations on the BaseX command line:
 == Non privleged -privileged User == 
BaseX is run under the {{Code|basex}} user with fixed user ID 1984. The user’s home directory is {{Code|/srv}}.
to <code>UID 1984</code>:
<presyntaxhighlight> chown -R 1984 ~/my-project/data</presyntaxhighlight>
== Networking ==
Several ports are exposed:
An example for creating your own Docker image based on {{Code|basex/basexhttp}} is the [ DBA application]. A {{Code|Dockerfile}} was added to the source code’s root directory. The very simple file contains only few statements:
FROM basex/basexhttp:latest
COPY . /srv/basex/webapp
For general production usage, you should choose a fixed version instead of the development branch behind {{Code|latest}}, so your application does not suddenly break because of unnoticed API changes. The most relevant part happens in the {{Code|COPY}} statement, which adds the file contents to the {{Code|webapp}} directory. That’s already it -- you’re ready to run.
If you need to adjust the BaseX configuration to tune the default [[Options|options]], add a {{Code|.basex}} file to {{Code|/srv}}:
COPY .basex /srv/basex
Options not defined in the {{Code|.basex}} file with be automatically set to the default values. Users and passwords can be defined by adding a {{Code|users.xml}} file, which is described on the [[User Management]] page.
Larger applications and databases might require adjusted JRE parameters like increasing the memory limit. You can change those by setting the {{Code|BASEX_JVM}} environment variable:
ENV BASEX_JVM="-Xmx2048m"
===Installing Additional Packages===
In [ alpine linux] you can add arbitrary software packages via APK. Make sure to switch to the {{Code|root}} user context before installing packages and back to the {{Code|basex}} user afterwards. As common in the Docker environment, you need to fetch the package catalog–in [ alpine linux] this is done using {{Code|apk update}}–before installing packages and disable caching to keep the image small. The example installs {{Code|git}} as additional linux package:
USER root
RUN apk update && apk add --no-cache git
USER basex
Bureaucrats, editor, reviewer, Administrators


Navigation menu