I have a project that when running locally, outputs server started at /127.0.0.1:5000
and I can access it locally on the said port just fine.
I am trying to run it through docker. I have the following:
DockerFile
:
FROM mozilla/sbt
ADD build.sbt /root/build/
RUN cd /root/build && sbt compile
EXPOSE 5000
WORKDIR /root/build
CMD sbt run
and the following docker-compose.yml
:
version: '3.1'
services:
sbt:
build:
context: ./
dockerfile: ./Dockerfile
image: sbt
ports:
- "8080:5000"
volumes:
- "./:/root/build"
I try running it through docker-compose up
and I can see the logs about the server starting, but can't access the service through the specified port, namely 8080
. Am I missing something?
fyi, the above setup is inspired by this post where I have changed the base image and also got rid of the external-network
bit that I did not understand.