From 195ccbef05828c6e4278873d89c0a2923e589a8f Mon Sep 17 00:00:00 2001 From: Shash Date: Wed, 30 Jul 2025 00:28:37 +0530 Subject: [PATCH 1/2] fix(docker):This resolves the Docker build failure by enabling corepack to use the correct Yarn version and copying the yarn.lock file to satisfy the --immutable install flag. Fixes #1782 --- Dockerfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ed9ac7892..9f3ea32f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,27 @@ +# Use Node 20 Alpine base image FROM node:20-alpine +# Set the working directory WORKDIR /app -COPY package*.json ./ +# Copy package files and Yarn config +COPY package*.json .yarnrc.yml yarn.lock ./ -RUN apk add --update git && \ +# Enable corepack (for yarn) +RUN corepack enable + +# Install git, initialize submodules, and install dependencies +RUN apk add --no-cache git && \ git init && \ git submodule init && \ git submodule update && \ - yarn + yarn install --immutable +# Copy all project files COPY . . +# Expose the dev server port EXPOSE 3000 -CMD yarn dev +# Start the development server +CMD ["yarn", "dev"] \ No newline at end of file From d62841d718c12f4817958f1c498e788da56419f5 Mon Sep 17 00:00:00 2001 From: Shash Date: Wed, 30 Jul 2025 00:32:08 +0530 Subject: [PATCH 2/2] Update Docker setup instructions in INSTALLATION.md Fixes #1782 Revised the Docker section to provide clearer, step-by-step instructions for building and running the development environment using Docker. Added details about directory navigation, image naming, port mapping, and live code updates. --- INSTALLATION.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 55ee890d0..81fb4eb2a 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -266,23 +266,34 @@ git commit -m "commit message" --no-verify ### Run locally using Docker -If you are a Docker lover, you have the option to use it following these instructions. +If you prefer using Docker, you can build and run the development environment in a container. #### Prerequisites: - [Install Docker](https://docs.docker.com/get-docker/) -After cloning repository to your local, perform the following steps from the root of the repository. - #### Steps: -1. Build the Docker image: + +After cloning the repository, navigate to the `website` directory, where the `Dockerfile` is located. + +```bash +cd website +``` + +1. **Build the Docker image:** + + Run the following command to build the Docker image. This will create an image named `json-schema-website`. + ```bash - make install + docker build -t json-schema-website . ``` -2. Start the container: +2. **Run the Docker container:** + + This command starts the container, mapping port 3000 and mounting your local `website` directory for live code updates. + ```bash - make run + docker run --rm -p 3000:3000 -v "./:/app" json-schema-website ``` -Now you're running JSON Schema website in a development mode. Container is mapped with your local copy of the website. Whenever you make changes to the code, the website will refresh and changes visible in `http://localhost:3000`. +You can now access the website at `http://localhost:3000`. The development server is running in your terminal. To stop it, press `Ctrl+C`.