Skip to content

Commit 514b330

Browse files
Fix for docker (#71)
* dockerization
1 parent 0426a6a commit 514b330

File tree

127 files changed

+11521
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+11521
-77
lines changed
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
11
# Configuration file for the example
22
##
3-
# Integration Key is the same as client id
3+
# Integration key is the same as client ID
44
DS_CLIENT_ID={DS_CLIENT_ID}
55
# Integration secret key
66
DS_CLIENT_SECRET={DS_CLIENT_SECRET}
77

88
# API Username
99
DS_IMPERSONATED_USER_GUID={DS_USER_GUID}
1010

11-
# target account id. Use FALSE to indicate that the user's default
12-
# account should be used.
11+
# Target account ID. Use FALSE to indicate that the user's default account should be used.
1312
DS_TARGET_ACCOUNT_ID=FALSE
1413

1514
DS_PAYMENT_GATEWAY_ID={DS_PAYMENT_GATEWAY_ID}
1615
DS_PAYMENT_GATEWAY_NAME={DS_PAYMENT_GATEWAY_NAME}
1716
DS_PAYMENT_GATEWAY_DISPLAY_NAME={DS_PAYMENT_GATEWAY_DISPLAY_NAME}
1817

19-
# The ID of clickwrap with dynamic content properties
20-
CLICKWRAP_ID={CLICKWRAP_ID}
21-
22-
# private key string - source or path, for instance: /app/id_rsa
18+
# Private key string - source or path, for instance: /home/user/app/id_rsa
2319
# NOTE: the Python config file parser requires that you
2420
# add a space at the beginning of the second and
2521
# subsequent lines of the multiline key value:
26-
DS_PRIVATE_KEY={DS_PRIVATE_KEY}
22+
DS_PRIVATE_KEY={RSA_KEY}
2723

24+
# The ID of clickwrap with dynamic content properties
25+
CLICKWRAP_ID={CLICKWRAP_ID}
2826
# React environment variables
29-
#UI and BE links
30-
REACT_APP_DS_RETURN_URL=http://localhost:3000
31-
REACT_APP_API_BASE_URL=http://localhost:5001/api
27+
# UI and BE links
28+
REACT_APP_DS_RETURN_URL=http://localhost
29+
REACT_APP_API_BASE_URL=http://localhost/api
3230

3331
# The DS Authentication server
3432
DS_AUTH_SERVER=https://account-d.docusign.com
3533

3634
# Demo Docusign API URL
3735
REACT_APP_DS_DEMO_SERVER=https://demo.docusign.net
38-
REACT_APP_DS_CLICKWRAP_URL=//demo.docusign.net/clickapi/sdk/latest/docusign-click.js
36+
REACT_APP_DS_CLICKWRAP_URL=https://demo.docusign.net/clickapi/sdk/latest/docusign-click.js

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
*.pyc
22
.idea
3+
private.key
34

45
.env
6+
57
__pycache__/
68
flask_session/
79

@@ -15,3 +17,4 @@ flask_session/
1517
# frontend
1618
/node_modules
1719
/build
20+
client/node_modules

client/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM --platform=linux/amd64 node:20.14 AS base
2+
3+
ARG REACT_APP_API_BASE_URL
4+
ENV REACT_APP_API_BASE_URL=$REACT_APP_API_BASE_URL
5+
6+
WORKDIR /app
7+
COPY .env ./
8+
COPY ./client/package.json ./client/yarn.lock ./
9+
RUN npm install
10+
11+
COPY ./client/ .
12+
13+
RUN npm run build
14+
15+
# Run stage
16+
FROM --platform=linux/amd64 nginx:1.23-alpine
17+
COPY --from=base /app/build /var/www/app
18+
COPY ./client/nginx/conf/ /etc/nginx/conf.d
19+
EXPOSE 80 443

client/nginx/conf/default.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
server {
2+
listen 80;
3+
listen 443;
4+
5+
server_tokens off;
6+
7+
root /var/www/app;
8+
location / {
9+
autoindex on;
10+
autoindex_exact_size off;
11+
try_files $uri /index.html;
12+
}
13+
14+
location /api {
15+
# rewrite ^/api(/.+) /$1 break;
16+
# rewrite "^/api/(.*)$" /$1 break;
17+
18+
proxy_set_header X-Real-IP $remote_addr;
19+
proxy_set_header X-Real-Port $remote_port;
20+
proxy_set_header Host $http_host;
21+
proxy_connect_timeout 3000;
22+
proxy_send_timeout 3000;
23+
proxy_read_timeout 3000;
24+
proxy_pass http://backend:5001;
25+
}
26+
}
27+
File renamed without changes.
File renamed without changes.

client/public/index.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<!-- Google Tag Manager -->
6+
<script>(function (w, d, s, l, i) {
7+
w[l] = w[l] || [];
8+
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
9+
var f = d.getElementsByTagName(s)[0],
10+
j = d.createElement(s),
11+
dl = l != 'dataLayer' ? '&l=' + l : '';
12+
j.async = true;
13+
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
14+
j.onerror = function () {
15+
console.error('GTM failed to load');
16+
};
17+
f.parentNode.insertBefore(j, f);
18+
})(window, document, 'script', 'dataLayer', 'GTM-WPK6FN5');</script>
19+
<!-- End Google Tag Manager -->
20+
<meta charset="utf-8" />
21+
<link rel="icon" href="favicon.png" />
22+
<meta name="viewport" content="width=device-width, initial-scale=1" />
23+
<meta name="theme-color" content="#000000" />
24+
<meta name="description" content="Web site created using create-react-app" />
25+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
26+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
27+
<title>MySure Docusign Sample Application</title>
28+
<meta name="description"
29+
content="See how the MySure Docusign sample application for insurance showcases the capabilities of the Docusign API to enable you to integrate Docusign functionality into your own applications.">
30+
<meta property="og:type" content="article" />
31+
<meta name="twitter:title" content="MySure Docusign Sample Application" />
32+
<meta name="twitter:description"
33+
content="See how the MySure Docusign sample application for insurance showcases the capabilities of the Docusign API to enable you to integrate Docusign functionality into your own applications." />
34+
<meta property="og:title" content="MySure Docusign Sample Application" />
35+
<meta property="og:description"
36+
content="See how the MySure Docusign sample application for insurance showcases the capabilities of the Docusign API to enable you to integrate Docusign functionality into your own applications." />
37+
<meta property="og:image" content="%PUBLIC_URL%/MySure_OG.png" />
38+
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap"
39+
rel="stylesheet">
40+
<link
41+
href="https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Noto+Serif&display=swap"
42+
rel="stylesheet">
43+
44+
</head>
45+
46+
<body>
47+
<noscript>You need to enable JavaScript to run this app.</noscript>
48+
<div id="root"></div>
49+
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
50+
<script src="https://demo.docusign.net/clickapi/sdk/latest/docusign-click.js"></script>
51+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"
52+
integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4"
53+
crossorigin="anonymous"></script>
54+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
55+
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
56+
crossorigin="anonymous"></script>
57+
</body>
58+
59+
</html>

0 commit comments

Comments
 (0)