diff --git a/Dockerfile b/Dockerfile index ca5c9c7..e240d43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/server/src/storage/json.ts b/server/src/storage/json.ts index be331b1..23a7b88 100644 --- a/server/src/storage/json.ts +++ b/server/src/storage/json.ts @@ -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. */