Persist prayer data to a mounted Docker volume via Express API
Replaces localStorage with a JSON-file backend (server.js). Prayers are stored in /data/prayers.json, which is mounted as a named Docker volume so data survives container restarts and rebuilds. React fetches from /api/prayers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DReRqHxSYuVfCzTzQGD9hZ
This commit is contained in:
6 files changed
+130
-54
No files matched your search
+11
-4
@@ -5,7 +5,14 @@ RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/build /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
COPY server.js ./
|
||||
COPY --from=build /app/build ./build
|
||||
|
||||
ENV DATA_DIR=/data
|
||||
VOLUME ["/data"]
|
||||
EXPOSE 4000
|
||||
CMD ["node", "server.js"]
|
||||
Reference in new issue
Block a user