Answer the question
In order to leave comments, you need to log in
How to properly set up SWAGGER_JSON in docker?
I've been banging my head for several days and I don't understand why the documentation file in swagger is not being uploaded to the production environment.
docker-compose.yml
nginx:
image: nginx:alpine
volumes:
- ${WORK_DIR}/server/nginx/${APP_ENV}/nginx.conf:/etc/nginx/nginx.conf
- ${WORK_DIR}/server/nginx/${APP_ENV}/swagger.conf:/etc/nginx/conf.d/swagger.conf
ports:
- 80:80
restart: always
depends_on:
- api
- swagger-ui
container_name: nginx
swagger-ui:
image: swaggerapi/swagger-ui
volumes:
- ./swagger:/docs
restart: always
environment:
SWAGGER_JSON: /docs/swagger.yml
container_name: swagger-ui
server {
listen 80;
server_name doc.swagger.loc;
location / {
proxy_pass http://swagger-ui:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question