Skip to content

Allow container listen port configuration with the PORT environment variable #5700

@r10r

Description

@r10r

Hi there,

I'm trying to run the swagger-editor docker image along with the swagger-ui image in a kubernetes pod.

I've upgraded the image from 4.x to 5.x and swagger editor was not reachable anymore.

+        image: docker.io/swaggerapi/swagger-editor:v5.1.0
         # See also https://github.com/swagger-api/swagger-editor
         env:
-          - name: BASE_URL
-            value: "/editor"
+          #- name: BASE_URL
+          #  value: "/editor"
           - name: QUERY_CONFIG_ENABLED
@@ -45,7 +45,10 @@ spec:
         ports:
           - name: http-editor
             protocol: TCP
-            containerPort: 8080
+            # NOTE PORT environment variable is ignored
+            # See also https://github.com/swagger-api/swagger-editor/issues/5700
+            containerPort: 80
-        image: docker.io/swaggerapi/swagger-editor:v4.11.2
+        image: docker.io/swaggerapi/swagger-editor:v5.1.0

With 5.x the swagger-ui container can no longer be configured with PORT and BASE_URL environment variables.
The nginx entrypoint is now overwritten. The EXPOSE 8080 is invalid because nginx defaults to port 80.

https://github.com/swagger-api/swagger-editor/blob/v5.1.0/Dockerfile
https://github.com/swagger-api/swagger-editor/blob/v4.11.2/Dockerfile

Is this on purpose ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions