File tree 4 files changed +38
-0
lines changed
4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
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" ]
Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments