From dc45f8d41d2dbfab4b7a8a5679810aeb5c7730a6 Mon Sep 17 00:00:00 2001 From: Aaron Kanzer Date: Thu, 17 Oct 2024 10:54:53 -0400 Subject: [PATCH 1/2] 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 000000000..4b9e3cebc --- /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 67ce4388f..58e47b2e0 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. From 9a31a105c4d0cd4ee03564c0c8db45a981fdd979 Mon Sep 17 00:00:00 2001 From: Aaron Kanzer Date: Tue, 22 Oct 2024 16:09:50 -0400 Subject: [PATCH 2/2] remove uncommented out lines --- Dockerfile.dev | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.dev b/Dockerfile.dev index 4b9e3cebc..16bb43bef 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -16,10 +16,10 @@ RUN npm install COPY . . # Install project dependencies -# RUN npm i +RUN npm i # Vue CLI serves on port 8080 by default, expose that port -# EXPOSE 8080 +EXPOSE 8080 # Command to run the app using npm -# CMD ["npm", "run", "dev-server"] +CMD ["npm", "run", "dev-server"]