From dc45f8d41d2dbfab4b7a8a5679810aeb5c7730a6 Mon Sep 17 00:00:00 2001 From: Aaron Kanzer Date: Thu, 17 Oct 2024 10:54:53 -0400 Subject: [PATCH] Include Dockerfile.dev and docs to run neuroglancer dev locally --- Dockerfile.dev | 25 +++++++++++++++++++++++++ README.md | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile.dev diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000000..4b9e3cebc2 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,25 @@ +# to run locally: +# docker build -f Dockerfile.dev -t . +# docker run -v $(pwd):/app -p 8080:8080 --rm + +FROM node:20.11.1 + +WORKDIR /app + +# Copy package.json and package-lock.json for installing dependencies +COPY package*.json ./ + +# Install project dependencies +RUN npm install + +# Copy the rest of your app's source code from your host to your image filesystem. +COPY . . + +# Install project dependencies +# RUN npm i + +# Vue CLI serves on port 8080 by default, expose that port +# EXPOSE 8080 + +# Command to run the app using npm +# CMD ["npm", "run", "dev-server"] diff --git a/README.md b/README.md index 67ce4388fd..58e47b2e01 100644 --- a/README.md +++ b/README.md @@ -187,3 +187,16 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +# Local Docker development + +To control versioning and development on your local machine, please reference the `Dockerfile.dev` as a convenience. + +To run the Dockerfile: + +```shell +docker build -f Dockerfile.dev -t . +docker run -v $(pwd):/app -p 8080:8080 --rm +``` + +Hot-reloading should be present.