Skip to content

Commit 1692cae

Browse files
authored
Merge branch 'master' into maintenance/may-2024
Signed-off-by: Raileen Del Rosario <[email protected]>
2 parents 0286417 + f162c3f commit 1692cae

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# start by pulling the python image
2+
FROM python:3.11.9-slim-bullseye
3+
4+
# copy the requirements file into the image
5+
COPY ./requirements.txt /app/requirements.txt
6+
7+
# switch working directory
8+
WORKDIR /app
9+
10+
# install the dependencies and packages in the requirements file
11+
RUN pip install -r requirements.txt
12+
13+
# copy every content from the local file to the image
14+
COPY . /app
15+
16+
# configure the container to run in an executed manner
17+
ENTRYPOINT [ "python" ]
18+
19+
CMD ["run.py", "--docker"]

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ For a list of code examples that use the Web Forms API, see the [How-to guides o
107107
**Note:** You will need to alias the python command to run Python 3 or use `python3 run.py`
108108
1. Open a browser to http://localhost:3000
109109

110+
### Installation steps with docker
111+
112+
**Note**: Running the launcher with docker will use Python 3.11
113+
114+
1. Open the Docker application
115+
1. `docker image build -t docusign .`
116+
1. `docker run --name docusign_python -p 3000:3000 -d docusign`
117+
1. Open a browser to http://localhost:3000
118+
110119
### Installation steps for JWT Grant authentication
111120

112121
**Note:** If you downloaded this code using [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/) from the Docusign Developer Center, skip step 4 as it was automatically performed for you.

run.py

100755100644
+6-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
from app import app
33
from flask_session import Session
44
import os
5+
import sys
6+
7+
host = "0.0.0.0" if "--docker" in sys.argv else "localhost"
8+
port = int(os.environ.get("PORT", 3000))
59

610
if os.environ.get("DEBUG", False) == "True":
711
app.config["DEBUG"] = True
812
app.config['SESSION_TYPE'] = 'filesystem'
913
sess = Session()
1014
sess.init_app(app)
11-
port = int(os.environ.get("PORT", 3000))
12-
app.run(host="localhost", port=3000, debug=True)
15+
app.run(host=host, port=port, debug=True)
1316
else:
1417
app.config['SESSION_TYPE'] = 'filesystem'
1518
sess = Session()
1619
sess.init_app(app)
17-
app.run(host="localhost", port=3000, extra_files="api_type.py")
20+
app.run(host=host, port=port, extra_files="api_type.py")
1821

0 commit comments

Comments
 (0)