From 92b54d3b72eb310159a05c18479c1fda001ff6e8 Mon Sep 17 00:00:00 2001 From: Candid Dauth Date: Thu, 16 Nov 2023 20:51:41 +0100 Subject: [PATCH] Fix GeoLite2 cache dir in Dockerfile --- Dockerfile | 3 ++- docs/src/developers/server/standalone.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index edd081f0..c30dec8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ MAINTAINER Candid Dauth CMD yarn run server EXPOSE 8080 +ENV CACHE_DIR=/opt/facilmap/cache RUN apk add --no-cache yarn @@ -21,6 +22,6 @@ RUN cd .. && yarn install RUN cd .. && yarn run build USER root -RUN chown -R root:root /opt/facilmap && mkdir -p /opt/facilmap/server/node_modules/.cache && chown -R facilmap:facilmap /opt/facilmap/server/node_modules/.cache +RUN chown -R root:root /opt/facilmap && mkdir -p "$CACHE_DIR" && chown -R facilmap:facilmap "$CACHE_DIR" USER facilmap diff --git a/docs/src/developers/server/standalone.md b/docs/src/developers/server/standalone.md index 8b53b772..8f6ed1b0 100644 --- a/docs/src/developers/server/standalone.md +++ b/docs/src/developers/server/standalone.md @@ -16,7 +16,7 @@ A bundled version of the FacilMap server is published on NPM as [facilmap-server 3. Create a `config.env` file based on [`config.env.example`](https://github.com/FacilMap/facilmap/blob/main/config.env.example) and to adjust the [configuration](./config.md). 4. Start the FacilMap server by running `~/.local/bin/facilmap-server dotenv_config_path=config.env`. -FacilMap will need write access to the directory `~/.local/lib/node_modules/.cache/facilmap-server`. All other files and directories can be read-only. To harden the FacilMap installation, make the whole installation folder owned by root, but create the cache directory and make it owned by the facilmap user. +FacilMap will need write access to the directory `~/.local/lib/node_modules/.cache/facilmap-server` (or specify another directory in the `CACHE_DIR` environment variable). All other files and directories can be read-only. To harden the FacilMap installation, make the whole installation folder owned by root, but create the cache directory and make it owned by the facilmap user. ## Run the development version