Skip to content

Commit ed38846

Browse files
committed
Persist LNT instance and config in docker-compose.yml
Otherwise the configuration is recreated everytime the image is launched and we lose all the profiles etc.
1 parent 7a2554e commit ed38846

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ services:
1818
condition: on-failure
1919
ports:
2020
- "8000:8000"
21+
volumes:
22+
- lnt_data:/var/lib/lnt
23+
- lnt_config:/etc/lnt
2124

2225
db:
2326
container_name: lnt-postgres
@@ -26,3 +29,7 @@ services:
2629
- POSTGRES_PASSWORD=${DB_PWD}
2730
- POSTGRES_USER=${DB_USER:-lntuser}
2831
- POSTGRES_DB=${DB_BASE:-lnt}
32+
33+
volumes:
34+
lnt_data:
35+
lnt_config:

docker/docker-entrypoint.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
DB_PATH=${DB_ENGINE:-postgresql}://${DB_USER:-lntuser}:${DB_PWD:?}@${DB_HOST:?}
44
DB_BASE=${DB_BASE:-lnt}
55

6-
if [ ! -r /etc/lnt.cfg ]; then
6+
if [ ! -r /etc/lnt/lnt.cfg ]; then
77
DB_BASE_PATH="${DB_PATH}/${DB_BASE}" wait_db
8-
lnt create /var/lib/lnt \
9-
--config /etc/lnt.cfg \
8+
lnt create /var/lib/lnt/instance \
9+
--config /etc/lnt/lnt.cfg \
1010
--wsgi lnt_wsgi.py \
1111
--tmp-dir /tmp/lnt \
1212
--db-dir "${DB_PATH}" \
1313
--default-db "${DB_BASE}"
1414
if [ -n "${LNT_AUTH_TOKEN:-}" ]; then
15-
sed -i "s/# \(api_auth_token =\).*/\1 '${LNT_AUTH_TOKEN}'/" /etc/lnt.cfg
15+
sed -i "s/# \(api_auth_token =\).*/\1 '${LNT_AUTH_TOKEN}'/" /etc/lnt/lnt.cfg
1616
fi
1717
fi
1818

19-
cd /var/lib/lnt
19+
cd /var/lib/lnt/instance
2020
exec gunicorn lnt_wsgi:application \
2121
--bind 0.0.0.0:8000 \
2222
--workers 8 \

0 commit comments

Comments
 (0)