Přesun json databaze (souboru db.json) do složky data, související úpravy v Dockerfile

This commit is contained in:
Michal Hájek 2025-02-02 16:09:07 +01:00
parent 44b09a9d1a
commit f3af64923c
2 changed files with 6 additions and 5 deletions

View File

@ -54,7 +54,6 @@ WORKDIR /app
# Vykopírování sestaveného serveru
COPY --from=builder /build/server/node_modules ./server/node_modules
COPY --from=builder /build/server/dist ./
COPY server/resources ./server/resources
# Vykopírování sestaveného klienta
COPY --from=builder /build/client/dist ./public
@ -63,8 +62,11 @@ COPY --from=builder /build/client/dist ./public
COPY /server/.env.production ./server/src
# Zkopírování konfigurace easter eggů
# TODO tohle spadne když nebude existovat!
COPY /server/.easter-eggs.json ./server/
RUN if [ -f /server/.easter-eggs.json ]; then cp /server/.easter-eggs.json ./server/; fi
# Export /data/db.json do složky /data
VOLUME ["/data"]
COPY /data/db.json /data/db.json
EXPOSE 3000

View File

@ -1,8 +1,7 @@
import JSONdb from 'simple-json-db';
import { StorageInterface } from "./StorageInterface";
const db = new JSONdb('./data.json');
const db = new JSONdb('../data/db.json');
/**
* Implementace úložiště používající JSON soubor.
*/