Skip to content

Commit

Permalink
Adding Docker Setup (json-schema-org#387)
Browse files Browse the repository at this point in the history
* dockerising website

* compose fix

* adding makefile

* makefile fix

* Delete README.Docker.md

* adding dokcer installation guide in readme

* adding dokcer installation guide in readme

* Update README.md

Co-authored-by: Benjamin Granados <[email protected]>

---------

Co-authored-by: Benjamin Granados <[email protected]>
  • Loading branch information
DhairyaMajmudar and benjagm authored Mar 1, 2024
1 parent 6d1e3fc commit a1d4f66
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/

**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/dist
LICENSE
README.md
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:20-alpine

WORKDIR /app

COPY package*.json ./

RUN apk add --update git && \
git init && \
git submodule init && \
git submodule update && \
yarn

COPY . .

EXPOSE 3000

CMD yarn dev
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,29 @@ Build static files on /out folder
yarn build
```

### Run locally using Docker

If you are a Docker lover, you have the option to use it following these instructions.

#### 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:
```bash
make install
```

2. Start the container:
```bash
make run
```

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 localhost:3000.
## Project structure
This repository has the following structure:
Expand Down
4 changes: 4 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
install:
docker build -t app .
run:
docker run --rm -it -v "$PWD":/app -p 3000:3000 app

0 comments on commit a1d4f66

Please sign in to comment.