title: Change Swagger port in docker-compose
body: <p>I am unable to change the port that Swagger uses in docker compose. It works fine with regular docker, I simply set the -p argument on the run command. It seems that I should just need to set the ports field in the docker-compose file. But no matter what I try it just runs on 8080.</p>
  
  <p>I am using the latest versions of docker and docker-compose. The docker image is called swaggerapi/swagger-ui. I have attempted setting the ports field for the container. Also tried setting the url variable in the swagger definition file. Tried changing the expose port. I tried with the docker-compose run command which lets you start an individual service and has the -p argument. Still nothing.  </p>
  
  <p>Ideally I should use this to build and run:</p>
  
  <pre><code>sudo docker-compose up --build --force-recreate
  </code></pre>
  
  <p>My compose file:</p>
  
  <pre><code>version: '3'
  services:
  
  
    swagger:
      build: swagger
      network_mode: "host"
      ports:
        - "8081:8080"
      env_file: .env
      environment:
        - SWAGGER_JSON=/swagger.json
  
  volumes:
    data:
      driver: "local"
  
  </code></pre>
  
  <p>And the docker file for the swagger service:</p>
  
  <pre><code>FROM swaggerapi/swagger-ui
  
  EXPOSE 8081
  
  COPY swagger.json /swagger.json
  
  ENV SWAGGER_JSON "/swagger.json"
  </code></pre>
  
  <p>No matter what I do it wont change ports.</p>