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

feat: Dockerfiles created to create docker images to run sdk and demo app #262

Closed
wants to merge 2 commits into from
Closed
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
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:18 as base
WORKDIR /usr/src/web

COPY . .

RUN yarn install
RUN yarn re:start
RUN yarn build:prod



FROM nginx:alpine

RUN rm -rf /usr/share/nginx/html/*

COPY --from=base /usr/src/web/dist/prod /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 9050

CMD ["nginx", "-g", "daemon off;"]
25 changes: 21 additions & 4 deletions Hyperswitch-React-Demo-App/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
FROM node:18 as base
WORKDIR /usr/src/web_demo

FROM node:18-alpine
WORKDIR /usr/src/app
COPY package*.json ./
COPY . .

#WORKDIR /usr/src/web_demo/Hyperswitch-React-Demo-App
RUN yarn install
RUN node promptScript.js
RUN yarn build
CMD [ "yarn" ,"start-server" ]

EXPOSE 5252

CMD ["node", "dist/server.js"]



FROM nginx:alpine

RUN rm -rf /usr/share/nginx/html/*

COPY --from=base /usr/src/web_demo/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 5060

CMD ["nginx", "-g", "daemon off;"]
17 changes: 17 additions & 0 deletions Hyperswitch-React-Demo-App/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {
listen 9060;

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

location /api {
proxy_pass http://localhost:5252;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
8 changes: 8 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 9050;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ =404;
}
}
Loading