Changes

Jump to navigation Jump to search
120 bytes added ,  13:58, 27 February 2020
no edit summary
--publish 8984:8984 \
--volume "$(pwd)/basex/data":/srv/basex/data \
basex/basexhttp:latest</pre>
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:
</pre>
 == 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 [https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/webapp/dba DBA application]. A {{Code|Dockerfile}} was added to the source code’s root directory. The very simple file contains only few statements:
<presyntaxhighlight>
FROM basex/basexhttp:latest
MAINTAINER BaseX Team <basex-talk@mailman.uni-konstanz.de>
COPY . /srv/basex/webapp
</presyntaxhighlight>
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}}:
<presyntaxhighlight>
COPY .basex /srv/basex
</presyntaxhighlight>
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:
<presyntaxhighlight>
ENV BASEX_JVM="-Xmx2048m"
</presyntaxhighlight>
===Installing Additional Packages===
In [https://alpinelinux.org 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 [https://alpinelinux.org 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:
<presyntaxhighlight>
USER root
RUN apk update && apk add --no-cache git
USER basex
</presyntaxhighlight>
Bureaucrats, editor, reviewer, Administrators
12,250

edits

Navigation menu