Docker does not start when using swagger-ui image in docker #9347
              
                Unanswered
              
          
                  
                    
                      shiga-takaya-2
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 2 comments
-
| Hi! Did you solve this problem? | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            -
| Worked for me like that: services:
  swagger-ui:
    image: swaggerapi/swagger-ui
    container_name: "swagger-ui"
    ports:
      - "8080:8080"
    volumes:
      - ./swagger/openapi.yaml:/openapi.yaml
    environment:
      SWAGGER_JSON: /openapi.yaml
    healthcheck:
      test: ["CMD", "curl", "-f", "http://swagger-ui:8080/readiness"]
      interval: 200s
      timeout: 200s
      retries: 5Credits to Thanh Nguyen Van | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use my own openapi.yaml file and display it as swagger-ui.
The local environment directory is as follows:
├── swagger
│ └── openapi.yaml
└── dockerfile
└── docker-compose.yaml
The dockerfile is as follows.
After docker run, when checking docker logs, the following error is displayed and docker does not start. Please tell me the reason and solution.
In addition, the contents of 40-swagger-ui.sh are as follows.
◆supplement
Container up using docker-compose was successful.
docker-compose.yaml is as follows. This time, I want to make sure to replace the volumes in docker-compose.yaml with the COPY command in the dockerfile.
Beta Was this translation helpful? Give feedback.
All reactions