From fde44f3d2bc83f74ad0c91deba0ab647c9dc93f3 Mon Sep 17 00:00:00 2001 From: Robert Martin Date: Mon, 3 Feb 2025 18:44:06 -0600 Subject: [PATCH 1/2] fix: update dockerfile to reflect monorepo - Closes #1179 - Upgrades to current Node LTS (v22) - Uses "slim" Node image for smaller build (appears to work OK but haven't tested rigorously) - Runs `npm run demo` to be consistent with demo instructions in README --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e80c0e31..a222596d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Use the official Node.js image as the base image -FROM node:16.20.2 +FROM node:22-slim # Set the working directory in the Docker container WORKDIR /usr/src/app @@ -7,6 +7,9 @@ WORKDIR /usr/src/app # Copy the package.json and package-lock.json files to the container COPY package.json package-lock.json ./ +# Copy the packages in this monorepo to the container +COPY ./packages ./packages + # Install the required npm packages in the container RUN npm install @@ -17,4 +20,4 @@ COPY demo ./demo EXPOSE 8080 # Start the Koop server -CMD ["node", "demo/index.js"] \ No newline at end of file +CMD ["npm", "run", "demo"] From 8f25825a77f011e1f29e2254d62ac1c78a972657 Mon Sep 17 00:00:00 2001 From: Robert Martin Date: Mon, 3 Feb 2025 18:56:27 -0600 Subject: [PATCH 2/2] docs: add docker instructions to readme --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8920e5a89..171f11976 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,10 @@ Koop's plugin-architecture facilates custom deployments specific to your needs. ![lots of geojson into feature services](https://user-images.githubusercontent.com/7832202/28444721-43eb6ea6-6d8d-11e7-8d56-3af46fd5bf88.png) ## Demo -Want to see Koop in action? The repository ships with a demo that shows Koops support for GeoServices (ArcGIS). It leverages the file-geojson data provider and the GeoServices output-plugin: + +Want to see Koop in action? The repository ships with a demo that shows Koop's support for GeoServices (ArcGIS). It leverages the `file-geojson` data provider and the GeoServices output plugin. + +You can run the demo with npm: ```bash git clone https://github.com/koopjs/koop @@ -17,6 +20,14 @@ cd koop npm run demo ``` +Or if you'd prefer to run the demo in a Docker container: + +```bash +cd koop +docker build -t koop . +docker run -p 8080:8080 --rm koop +``` + Koop will start listening on port 8080. You should the following console logging noting the exposed file-geojson/GeoService routes: ```bash