Skip to content

Commit dc7cb3b

Browse files
committed
feature(docker): finish docker docs
close #248
1 parent d8a6c63 commit dc7cb3b

File tree

9 files changed

+1353
-1030
lines changed

9 files changed

+1353
-1030
lines changed

src/main/xar-resources/data/advanced-installation/advanced-installation.xml

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
<sect1 xml:id="headless">
2828
<title>Headless Installation</title>
29-
3029
<para>The <link xlink:href="basic-installation">Basic Installation</link> of eXist-db
3130
requires a graphical desktop. You can also install eXist on a headless (no GUI) system.
3231
For this launch the installer from the command line, using the <code>-console</code>
@@ -35,13 +34,18 @@
3534
<para>In console mode, the installer will prompt for several parameters (almost like the GUI
3635
version does). A dump of a sample interaction is shown below:</para>
3736
<programlisting xlink:href="listings/listing-2.txt"/>
37+
<sect2 xml:id="docker-compose"><title>Multi-container environments</title>
38+
<para>We highly recommend configuring a <literal>docker-compose.yml</literal> for local development or integration into multi-container environments.</para>
39+
<programlisting xlink:href="listings/listing-1.txt"/>
40+
<para>You can see an example configuration file below. Note that e.g.<code>${EXIST_DATA_DIR}</code> can be passed from an external file, and the use of the <code>volume</code> instructions. For all the available options please consult the <link xlink:href="https://docs.docker.com/compose/">docker compose</link> documentation.</para>
41+
<programlisting xlink:href="listings/listing-6.txt"/>
42+
</sect2>
3843
</sect1>
3944

4045
<!-- ================================================================== -->
4146

4247
<sect1 xml:id="service">
4348
<title>Running eXist-db as a Service</title>
44-
4549
<para>Instead of manually running the eXist-db server in a shell window, you can run it as a
4650
background service which is automatically launched during system start-up. This can be
4751
convenient, especially for servers. eXist-db continues to run even after users have
@@ -51,7 +55,6 @@
5155

5256
<sect2 xml:id="windows">
5357
<title>Windows</title>
54-
5558
<para>On Windows there are three identical options:</para>
5659
<itemizedlist>
5760
<listitem>
@@ -83,44 +86,56 @@
8386
<title>Unix/Linux</title>
8487
<para> If your system supports <code>systemd</code> you can run the service wrapper as a
8588
non-privileged user.</para>
86-
<para>Begin by creating a new user in your system which is being created specifically to run eXist-db as a service.
87-
You can do this by typing the following command:</para>
88-
<programlisting>sudo adduser --system --shell /sbin/nologin --comment "eXist-db Service Account" existdb</programlisting>
89-
<para>This command creates a new system user named "existdb" which does not need to login in order to run a service.
90-
In order for this new system user to be able to run eXist-db, we need to change the permission of eXist-db to
91-
match this new user. You do so by navigating to your <literal>$EXIST_HOME</literal> folder and typing the following two commands:</para>
92-
<programlisting xlink:href="listings/listing-3.txt"/>
93-
<para>These two commmands modify the ownership and group permissions recursively throughout the whole eXist-db project
94-
to your new existdb system user. Now only this user can run eXist-db.
95-
Next, navigate to the <literal>/etc/systemd/system</literal>
96-
sub-directory. Once there, create an exist-db.service file which contains the following information at
97-
a minimum:</para>
98-
<programlisting xlink:href="listings/listing-4.txt"/>
99-
<para>Once this file is stored in this location, you need to update permissions.
100-
Give ownership of this file to the exist user by using the following commands:</para>
101-
<programlisting xlink:href="listings/listing-5.txt"/>
102-
<para>Below is a list of common commands to interact with the newly created and configured service:</para>
89+
<para>Begin by creating a new user in your system which is being created specifically to
90+
run eXist-db as a service. You can do this by typing the following command:</para>
91+
<programlisting>sudo adduser --system --shell /sbin/nologin --comment "eXist-db Service Account" existdb</programlisting>
92+
<para>This command creates a new system user named "existdb" which does not need to
93+
login in order to run a service. In order for this new system user to be able to run
94+
eXist-db, we need to change the permission of eXist-db to match this new user. You
95+
do so by navigating to your <literal>$EXIST_HOME</literal> folder and typing the
96+
following two commands:</para>
97+
<programlisting xlink:href="listings/listing-3.txt"/>
98+
<para>These two commmands modify the ownership and group permissions recursively
99+
throughout the whole eXist-db project to your new existdb system user. Now only this
100+
user can run eXist-db. Next, navigate to the <literal>/etc/systemd/system</literal>
101+
sub-directory. Once there, create an exist-db.service file which contains the
102+
following information at a minimum:</para>
103+
<programlisting xlink:href="listings/listing-4.txt"/>
104+
<para>Once this file is stored in this location, you need to update permissions. Give
105+
ownership of this file to the exist user by using the following commands:</para>
106+
<programlisting xlink:href="listings/listing-5.txt"/>
107+
<para>Below is a list of common commands to interact with the newly created and
108+
configured service:</para>
103109
<itemizedlist>
104110
<listitem>
105-
<para><code>sudo systemctl start exist-db.service</code> - Enter command to start eXist-db</para>
111+
<para><code>sudo systemctl start exist-db.service</code> - Enter command to
112+
start eXist-db</para>
106113
</listitem>
107114
<listitem>
108-
<para><code>sudo systemctl stop exist-db.service</code> - Enter command to stop eXist-db</para>
115+
<para><code>sudo systemctl stop exist-db.service</code> - Enter command to stop
116+
eXist-db</para>
109117
</listitem>
110118
<listitem>
111-
<para><code>sudo systemctl enable exist-db.service</code> - Enter command to enable eXist-db to automatically start running after a reboot of your system</para>
119+
<para><code>sudo systemctl enable exist-db.service</code> - Enter command to
120+
enable eXist-db to automatically start running after a reboot of your
121+
system</para>
112122
</listitem>
113123
<listitem>
114-
<para><code>sudo systemctl disable exist-db.service</code> - Enter commande to disable eXist-db from automatically starting after a reboot of your system</para>
124+
<para><code>sudo systemctl disable exist-db.service</code> - Enter commande to
125+
disable eXist-db from automatically starting after a reboot of your
126+
system</para>
115127
</listitem>
116128
<listitem>
117-
<para><code>sudo systemctl restart exist-db.service</code> - Enter command to restart eXist-db</para>
129+
<para><code>sudo systemctl restart exist-db.service</code> - Enter command to
130+
restart eXist-db</para>
118131
</listitem>
119132
<listitem>
120-
<para><code>systemctl status exist-db</code> - Enter command to check the status of eXist-db</para>
133+
<para><code>systemctl status exist-db</code> - Enter command to check the status
134+
of eXist-db</para>
121135
</listitem>
122136
<listitem>
123-
<para><code>journalctl</code> - Run the following command to check systemd journal:</para>
137+
<para><code>journalctl</code> - Run the following command to check systemd
138+
journal:</para>
124139
</listitem>
125140
</itemizedlist>
126141
</sect2>
@@ -133,7 +148,7 @@
133148

134149
<para>Included in the distribution are a number of useful <literal>.sh</literal> (Unix
135150
Shell) and <literal>.bat</literal> (Windows batch) programs located in the
136-
<literal>bin</literal> sub-directory. Their names speak for themselves.</para>
151+
<literal>bin</literal> sub-directory. Their names speak for themselves.</para>
137152
<para>However, if you find that programs do not launch, you can try to manually launch them
138153
on the command-line without the scripting wrapper. This often provides useful debugging
139154
information.</para>
@@ -162,7 +177,8 @@
162177
<varlistentry>
163178
<term> <code>client.sh</code> (Unix) / <code>client.bat</code> (Windows)</term>
164179
<listitem>
165-
<para>Use one of these scripts to launch the <link xlink:href="java-admin-client">Java Admin Client</link>.</para>
180+
<para>Use one of these scripts to launch the <link
181+
xlink:href="java-admin-client">Java Admin Client</link>.</para>
166182
</listitem>
167183
</varlistentry>
168184
</variablelist>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# starting eXist-db
2+
docker-compose up -d
3+
# stop eXist-db
4+
docker-compose down
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '3.6'
2+
services:
3+
exist:
4+
image: existdb/existdb:release
5+
container_name: exist
6+
ports:
7+
- 8080:8080
8+
- 8443:8443
9+
networks:
10+
- www
11+
volumes:
12+
- type: volume
13+
source: data
14+
target: ${EXIST_HOME}/${EXIST_DATA_DIR}
15+
- type: volume
16+
source: config
17+
target: ${EXIST_HOME}/${EXIST_CONFIG_DIR}
18+
19+
volumes:
20+
data:
21+
driver: local
22+
name: exist-data
23+
config:
24+
driver: local
25+
name: exist-config
26+
27+
networks:
28+
www:
29+
name: www
30+
driver: bridge

0 commit comments

Comments
 (0)