Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockefile conf updated cache. Created other conf for dockerisation. #353

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Ignore node modules as they will be installed in the Dockerfile
node_modules/

# Ignore local configuration and cache files
.cache/
.config/
.DS_Store

# Ignore logs
*.log

# Ignore test and development files
*.md
*.test.js
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Builder
FROM node:18-alpine as builder
WORKDIR /src

# Cache dependencies first
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Copy other files and build
COPY . /src/
RUN yarn install --frozen-lockfile && yarn build
RUN yarn build

# App
FROM nginxinc/nginx-unprivileged
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ If you want to run JSON Crack locally:
# Build a Docker image with:
docker build -t jsoncrack .

# Run locally with:
# Run locally with `docker run`
docker run -p 8888:8080 jsoncrack

# Run locally with `docker-compose`
docker-compose up -d

# Go to http://localhost:8888
```

Expand Down
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.9'
services:
jsoncrack:
image: jsoncrack
container_name: jsoncrack
build:
context: .
dockerfile: Dockerfile
ports:
- "8888:8080"
Loading