mirror of
https://github.com/dokku/dokku.git
synced 2026-02-24 04:00:36 +01:00
fix: exit non-zero when git:from-image deploys fail to start the app
Also ensure the repository doesn't get updated to an invalid state in those failure cases. Closes #5538
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
FROM python:3.11.0-buster
|
||||
|
||||
ARG BUILD_ARG=key
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . /app
|
||||
|
||||
RUN echo $BUILD_ARG > BUILD_ARG.contents
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import http.server
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
class GetHandler(http.server.BaseHTTPRequestHandler):
|
||||
@@ -17,6 +18,10 @@ class GetHandler(http.server.BaseHTTPRequestHandler):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if os.getenv("FAIL_ON_STARTUP") == "true":
|
||||
print("Failing on startup due to FAIL_ON_STARTUP=true")
|
||||
sys.exit(1)
|
||||
|
||||
port = int(os.getenv("PORT", 5000))
|
||||
server = http.server.HTTPServer(("0.0.0.0", port), GetHandler)
|
||||
print("Listening on port {0}".format(port))
|
||||
|
||||
Reference in New Issue
Block a user