Skip to content

Commit

Permalink
fix: bug fix for dockerize (#174)
Browse files Browse the repository at this point in the history
<!--
  For Work In Progress Pull Requests, please use the Draft PR feature,
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for
further details.
  
  For a timely review/response, please avoid force-pushing additional
  commits if your PR already received reviews or comments.
  
Before submitting a Pull Request, please ensure you've done the
following:
- 📖 Read the [Contributing
Guide](https://github.com/uncefact/project-vckit/blob/main/CONTRIBUTING.md).
- 📖 Read the [Code of
Conduct](https://github.com/uncefact/project-vckit/blob/main/CODE_OF_CONDUCT.md).
  - 👷‍♀️ Create small PRs. In most cases, this will be possible.
  - ✅ Provide tests for your changes.
- 📝 Use descriptive commit messages following [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/).
- 📗 Update any related documentation and include any relevant
screenshots.
-->

## What type of PR is this? (check all applicable)

- [ ] 🍕 Feature
- [x] 🐛 Bug Fix
- [ ] 📝 Documentation Update
- [ ] 🎨 Style
- [ ] 🧑‍💻 Code Refactor
- [ ] 🔥 Performance Improvements
- [ ] ✅ Test
- [ ] 🤖 Build
- [ ] 🔁 CI
- [ ] 📦 Chore (Release)
- [ ] ⏩ Revert

## Description

<!-- 
Please do not leave this blank 
This PR [adds/removes/fixes/replaces] the [feature/bug/etc]. 
-->

## Related Tickets & Documents
<!-- 
Please use this format link issue numbers: Fixes #123

https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Mobile & Desktop Screenshots/Recordings

<!-- Visual changes require screenshots -->


## Added tests?

- [ ] 👍 yes
- [x] 🙅 no, because they aren't needed
- [ ] 🙋 no, because I need help

## Added to documentation?

- [ ] 📜 README.md
- [ ] 📓 [vc-kit doc site](https://uncefact.github.io/vckit/)
- [ ] 📕 storybook
- [x] 🙅 no documentation needed

## [optional] Are there any post-deployment tasks we need to perform?


<!-- note: PRs with deleted sections will be marked invalid -->
  • Loading branch information
huynguyen-hl committed May 28, 2024
1 parent 698f3a2 commit 7422328
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
15 changes: 9 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
*Dockerfile*
*docker-compose*
node_modules
*/__test__/*
coverage
build
docker-compose.yaml
.dockerignore
**/Dockerfile
**/node_modules
**/__test__
**/coverage
**/build
**/tsconfig.tsbuildinfo
.git
.github
.gitignore
jest.*
*.md
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ version: '3.8'

services:
demo-explorer:
image: demo-explore
build:
context: .
dockerfile: packages/demo-explorer/Dockerfile
ports:
- 3000:80
restart: unless-stopped
Expand Down
7 changes: 4 additions & 3 deletions packages/demo-explorer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:18 AS builder
WORKDIR /app
ENV NODE_OPTIONS=--max-old-space-size=16384
COPY ../../pnpm-workspace.yaml .
COPY package.json .
COPY . .
RUN npm install -g [email protected] && pnpm install

COPY . .
WORKDIR /app/packages/core-types
RUN pnpm run build
WORKDIR /app/packages/example-documents
RUN pnpm run build
WORKDIR /app/packages/react-components
Expand All @@ -16,6 +16,7 @@ WORKDIR /app/packages/demo-explorer
RUN pnpm run build

FROM nginx:alpine
COPY packages/demo-explorer/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/packages/demo-explorer/build/explorer /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
15 changes: 15 additions & 0 deletions packages/demo-explorer/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

0 comments on commit 7422328

Please sign in to comment.