Skip to content

Commit c3cd56c

Browse files
author
Adriano Santos
committed
feat: added example and test app
1 parent d84d4a9 commit c3cd56c

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

tools/sdk-init/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dockerfile for test
2+
FROM python:3.11-slim
3+
4+
# Install necessary dependencies for the example Python app
5+
RUN pip install flask
6+
7+
# Set the working directory
8+
WORKDIR /app
9+
10+
# Copy the binary from the builder stage
11+
COPY ./bin/sdk-init /usr/local/bin/sdk-init
12+
13+
# Add the example Python app
14+
COPY ./example-app/app.py /app
15+
COPY ./example-app/protos /protos
16+
17+
# Expose the Flask application port
18+
EXPOSE 5000
19+
20+
# Entrypoint runs the main binary first
21+
ENTRYPOINT ["sdk-init"]
22+
23+
# CMD runs the Flask application
24+
CMD ["python", "app.py"]

tools/sdk-init/example-app/app.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from flask import Flask, jsonify
2+
3+
app = Flask(__name__)
4+
5+
@app.route("/")
6+
def index():
7+
return jsonify({"message": "User application is running!"})
8+
9+
@app.route("/status")
10+
def status():
11+
return jsonify({"status": "ok", "description": "Flask app is healthy!"})
12+
13+
if __name__ == "__main__":
14+
app.run(host="0.0.0.0", port=5000)

tools/sdk-init/example-app/protos/test.proto

Whitespace-only changes.

tools/sdk-init/shared/protos/test.proto

Whitespace-only changes.

0 commit comments

Comments
 (0)