Closed Hjortur17 closed 2 years ago
Where is the docker-compose file located? If you want to have a docker-compose file that runs the server, db and client you'll need to have it top level, then change the build context, e.g. in the server the build context is "." because it's the current directory, when the docker-compose is top level in your repo you need to change the build context to the path to either the client or the server, depending on the service.
@Fanneyyy Why is there no network in the server docker-compose.yaml? Isn't it recommended when you have a docker compose with multiple services that communicate internally to have a network setup for local communication, instead of exposing it on the host?
We're only using the docker compose to run services locally, not in a remote cluster so just what you feel is nice to be able to run services locally and have them communicate, dealer's choice 😊
I have the docker-compose
file located at the root of the project.
Here is the client (the httpbin is the same) for example:
client:
build: ./src/connect4-client
ports:
- "3000:3000"
And then I have the server basically the same as from the file which was provided but I don't have the links and depends_on section.
Looks like it something related to httpbin, because it doesn't have a Dockerfile. Are we suppose to create one or is there some image that we can use?
httpbin does not need a dockerfile, the image is always fetched from dockerhub, you can skip it, no need to add it to the docker-compose file :)
Okay, but I don't fully understand why it isn't fetching these two dependancies
Okay I was able to get this working by running this command: rm ~/.docker/config.json
But I would like to know if this is what we are suppose to get :)
It looks like only the server and client are running.
docker ps -a
This command should show you a list of all containers on your computer. If it lists server, database, migration and client, and the migration one is stoped/exited, you should be good.
Expected Behaviour
I am trying to finish up day 06 by creating
docker-compose.yaml
fileCurrent Behaviour
I get some weird error (see picture below)
Context
Failure Logs