Added data persistance to memory server

This commit is contained in:
DustyPullRequest
2025-04-07 14:09:42 -04:00
committed by GitHub
parent 608ec8fd72
commit 451c207592
3 changed files with 14 additions and 2 deletions

View File

@@ -38,8 +38,11 @@ RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt
# Change the ownership of /app directory and its contents to appuser
RUN chown -R ${UID}:${UID} /app
# Change the ownership of /app/data directory and its contents to appuser
RUN mkdir -p /app/data && touch /app/data/memory.json && chown -R ${UID}:${UID} /app/data
# Set a flag for the location of the database
ENV MEMORY_FILE_PATH="/app/data/memory.json"
# Switch to the non-privileged user to run the application.
USER appuser