Trouble Deploying With docker-compose

I’m fairly new to Docker so excuse any obvious mistakes but I have spent basically all day trying to figure out something which I feel should be easy so I’m caving and asking the question here.

I have succesfully built a container using docker-compose, I have uploaded it to Docker Hub, I spun up a droplet on DigitalOcean, and I pulled the image (confirmed with docker images). But this is where I am stuck.

If I run docker run [container] then nothing happens (and if I run docker ps nothing shows). If I do it with the -it flag then I am insider the container and can access all files (including the original .yml file), but I feel like I shouldn’t run docker-compose up from here. But when I try running docker-compose up from anywhere else, it says that I need a .yml file and when I create one, it attempts to rebuild the container.

So, how do I pull down an image that I built with docker-compose and then run it on a remote server? I’m ready to scrap it all and just use vanilla docker as most tutorials suggest.

Thanks for any help :slight_smile:

I’m guessing, you’re using build: instead of image: in your yaaml file :wink:

This is my yaaml file:

version: "3"
services:
  streamlit:
    build: .
    command: "streamlit run src/app.py"
    ports:
      - "8501:8501"
    volumes:
      - "./src:/usr/src/app/src"

Should it be:

image: .

instead?