Skip to content

Commit a1d4f66

Browse files
Adding Docker Setup (#387)
* 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]>
1 parent 6d1e3fc commit a1d4f66

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

.dockerignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Include any files or directories that you don't want to be copied to your
2+
# container here (e.g., local build artifacts, temporary files, etc.).
3+
#
4+
# For more help, visit the .dockerignore file reference guide at
5+
# https://docs.docker.com/go/build-context-dockerignore/
6+
7+
**/.classpath
8+
**/.dockerignore
9+
**/.env
10+
**/.git
11+
**/.gitignore
12+
**/.project
13+
**/.settings
14+
**/.toolstarget
15+
**/.vs
16+
**/.vscode
17+
**/.next
18+
**/.cache
19+
**/*.*proj.user
20+
**/*.dbmdl
21+
**/*.jfm
22+
**/charts
23+
**/docker-compose*
24+
**/compose*
25+
**/Dockerfile*
26+
**/node_modules
27+
**/npm-debug.log
28+
**/obj
29+
**/secrets.dev.yaml
30+
**/values.dev.yaml
31+
**/build
32+
**/dist
33+
LICENSE
34+
README.md

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:20-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN apk add --update git && \
8+
git init && \
9+
git submodule init && \
10+
git submodule update && \
11+
yarn
12+
13+
COPY . .
14+
15+
EXPOSE 3000
16+
17+
CMD yarn dev

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@ Build static files on /out folder
6161
yarn build
6262
```
6363

64+
### Run locally using Docker
65+
66+
If you are a Docker lover, you have the option to use it following these instructions.
67+
68+
#### Prerequisites:
69+
70+
- [install Docker](https://docs.docker.com/get-docker/)
71+
72+
After cloning repository to your local, perform the following steps from the root of the repository.
73+
74+
#### Steps:
75+
1. Build the Docker image:
76+
```bash
77+
make install
78+
```
79+
80+
2. Start the container:
81+
```bash
82+
make run
83+
```
84+
85+
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.
86+
6487
## Project structure
6588
6689
This repository has the following structure:

makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
install:
2+
docker build -t app .
3+
run:
4+
docker run --rm -it -v "$PWD":/app -p 3000:3000 app

0 commit comments

Comments
 (0)