planning-fight/Dockerfile.jsonserver
2025-11-04 15:18:19 +01:00

19 lines
353 B
Docker

FROM node:20-alpine
WORKDIR /app
# Install json-server globally
RUN npm install -g json-server@0.17.4
# Create data directory
RUN mkdir -p /data
# Copy initial db.json
COPY db.json /data/db.json
EXPOSE 3001
# Use volume mount for persistence
VOLUME ["/data"]
CMD ["json-server", "--watch", "/data/db.json", "--host", "0.0.0.0", "--port", "3001"]