title: Spring boot running as container issues
body: <p>I am running a spring boot with REST API inside a docker container. Everything seems to work fine when i run from eclipse or as jar. But when i dockerize it and run i am facing below issues</p>
  
  <p><strong>First</strong>
  Not able to access REST Endpoint within container. </p>
  
  <p><code>http://localhost:9000/</code>  --> works But</p>
  
  <p><code>http://localhost:9000/api/v1/test</code> --> it does not identify.</p>
  
  <p>However i can run it from swagger.</p>
  
  <p><strong>Second issue</strong> org.postgresql.util.PSQLException: ERROR: permission denied for schema   &lt; schema_name ></p>
  
  <p>However i have given all permissions for the schema like </p>
  
  <pre><code>GRANT ALL ON SCHEMA &lt; schemaname&gt; TO &lt; username&gt;;
  GRANT USAGE ON SCHEMA &lt; schemaname&gt; TO &lt; username&gt;;
  </code></pre>
  
  <p>These issues are only when i try to run from a container. </p>
  
  <p>Commands use for docker</p>
  
  <p><code>docker run -p 9000:9000  &lt; image name &gt;</code></p>
  
  <p>Am using spring boot 2.1.9</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM openjdk:8-jdk-alpine
  VOLUME /tmp
  ADD run-app.sh run-app.sh
  RUN chmod +x run-app.sh
  EXPOSE 9000
  ARG JAR_FILE=target/*.jar
  COPY ${JAR_FILE} dummy.jar
  ENTRYPOINT ./run-app.sh
  </code></pre>
  
  <p><strong>run-app.sh</strong></p>
  
  <pre><code>java  $JAVA_OPTS -jar /dummy.jar
  </code></pre>
  
  <p><strong>My postgresql Db is running in aws.</strong></p>
  
  <p>My spring boot is able to start, but only while my API is querying i am facing the exception</p>