Skip to content

Commit 518650f

Browse files
committed
working searx-docker.service
1 parent 86f1f7e commit 518650f

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

searx-docker.service.template

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
<[Unit]
1+
[Unit]
22
Description=searx service
33
Requires=docker.service
44
After=docker.service
55

66
[Service]
77
Restart=always
88

9+
Environment=SEARX_DIR=/usr/local/searx-docker
910
Environment=SEARX_DOCKERCOMPOSEFILE=docker-compose.yaml
1011

11-
WorkingDirectory=/usr/local/searx-docker
12-
13-
ExecStart=/bin/sh -c "start.sh"
14-
ExecStop=/bin/sh -c "stop.sh"
12+
ExecStart=/bin/sh -c "${SEARX_DIR}/start.sh"
13+
ExecStop=/bin/sh -c "${SEARX_DIR}/stop.sh"
1514

1615
[Install]
1716
WantedBy=multi-user.target

start.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/sh
22

3+
BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
4+
cd -- "$BASE_DIR"
5+
36
. ./util.sh
47

58
if grep -q "MORTY_KEY=RemplaceWithARealKey!" .env; then

stop.sh

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/sh
22

3+
BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
4+
cd -- "$BASE_DIR"
5+
36
. ./util.sh
47

58
$DOCKERCOMPOSE -f $DOCKERCOMPOSEFILE down -v

util.sh

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
BASE_DIR="$(dirname -- "`readlink -f -- "$0"`")"
2-
cd -- "$BASE_DIR"
31
set -e
42

53
DOCKERCOMPOSE=$(which docker-compose || echo "/usr/local/bin/docker-compose")

0 commit comments

Comments
 (0)