Skip to content
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ WORKDIR /usr/src/parser
ADD . /usr/src/parser
RUN mvn -q -f /usr/src/parser/pom.xml clean install -U

EXPOSE 5600
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did this work before? port option passed via Docker command line?

Copy link
Author

@micaelbergeron micaelbergeron Oct 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the new docker-compose is using named services to access the other services instead of going through the host networking. It is good practice to EXPOSE listening ports on your docker components, it makes it easy to expose the service to other components.

As you can see in docker-compose.yml

    environment:
      PARSER_HOST: http://odota-parser:5600
      POSTGRES_URL: postgresql://postgres:postgres@odota-postgres/yasp
      POSTGRES_TEST_URL: postgresql://postgres:postgres@odota-postgres/yasp_test
      READONLY_POSTGRES_URL: postgresql://readonly:readonly@odota-postgres/yasp
      REDIS_URL: redis://odota-redis:6379/0
      REDIS_TEST_URL: redis://odota-redis:6379/1
      CASSANDRA_URL: cassandra://odota-cassandra/yasp
      CASSANDRA_TEST_URL: cassandra://odota-cassandra/yasp_test

I think docker-compose automatically expose the image EXPOSED ports.


CMD ["java", "-jar", "-Xmx256m", "/usr/src/parser/target/stats-0.1.0.jar", "5600"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will you need to update this for the jar name?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I've changed the pom.xml to output the same filename as before.