mirror of
https://github.com/open-webui/openapi-servers
synced 2025-06-26 18:17:04 +00:00
Added data persistance to memory server
This commit is contained in:
parent
608ec8fd72
commit
451c207592
@ -9,9 +9,13 @@ services:
|
|||||||
context: ./servers/memory
|
context: ./servers/memory
|
||||||
ports:
|
ports:
|
||||||
- 8082:8000
|
- 8082:8000
|
||||||
|
volumes:
|
||||||
|
- memory:/app/data:rw
|
||||||
time-server:
|
time-server:
|
||||||
build:
|
build:
|
||||||
context: ./servers/time
|
context: ./servers/time
|
||||||
ports:
|
ports:
|
||||||
- 8083:8000
|
- 8083:8000
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
memory:
|
||||||
|
@ -38,8 +38,11 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
|||||||
--mount=type=bind,source=requirements.txt,target=requirements.txt \
|
--mount=type=bind,source=requirements.txt,target=requirements.txt \
|
||||||
python -m pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
|
|
||||||
# Change the ownership of /app directory and its contents to appuser
|
# Change the ownership of /app/data directory and its contents to appuser
|
||||||
RUN chown -R ${UID}:${UID} /app
|
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.
|
# Switch to the non-privileged user to run the application.
|
||||||
USER appuser
|
USER appuser
|
||||||
|
@ -4,4 +4,9 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
ports:
|
ports:
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
|
volumes:
|
||||||
|
- memory:/app/data:rw
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
memory:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user