We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c4376ed commit d505fb4Copy full SHA for d505fb4
helloworld-samples/app-python/Dockerfile
@@ -0,0 +1,20 @@
1
+# Download dependencies in builder stage
2
+FROM registry.access.redhat.com/ubi9/python-311 AS builder
3
+
4
+COPY requirements.txt .
5
+RUN python -m pip install -r requirements.txt
6
7
+# Build final stage
8
+FROM gcr.io/distroless/python3
9
10
+ENV PYTHONPATH=/app/site-packages
11
12
+COPY --chown=1001:0 --from=builder /opt/app-root/lib/python3.11/site-packages ${PYTHONPATH}
13
+COPY --chown=1001:0 Procfile /app/
14
+COPY --chown=1001:0 main.py /app/
15
16
+USER 1001:0
17
+WORKDIR /app
18
19
+CMD ["main.py"]
20
helloworld-samples/app-python/main.py
@@ -1,6 +1,5 @@
import os
-import jsonify
-from flask import Flask
+from flask import Flask, jsonify
app = Flask(__name__)
0 commit comments