swagger-api / swagger-api/swagger-editor

Allow container listen port configuration with the `PORT` environment variable

Open
#5,700 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
9.5k
Forks
2.4k
Avg merge
17h 15m
Merged PRs (30d)
18

Description

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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the v5.1.0 and v4.11.2 Dockerfiles linked in the issue, focusing on the nginx entrypoint, EXPOSE declaration, and PORT or BASE_URL handling. Verify how the v5 container starts and confirm the container becomes reachable on the configured PORT while preserving the documented configuration behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx
Domain
devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.