Interactive shell using Docker Compose

Is there any way to start an interactive shell in a container using Docker Compose only? I’ve tried something like this, in my docker-compose.yml: myapp: image: alpine:latest entrypoint: /bin/sh When I start this container using docker-compose up it’s exited immediately. Are there any flags I can add to the entrypoint command, or as an additional … Read more

Communication between multiple docker-compose projects

I have two separate docker-compose.yml files in two different folders: ~/front/docker-compose.yml ~/api/docker-compose.yml How can I make sure that a container in front can send requests to a container in api? I know that –default-gateway option can be set using docker run for an individual container, so that a specific IP address can be assigned to … Read more

What’s the difference between Docker Compose vs. Dockerfile [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. The community is reviewing whether to reopen this question as of 3 days ago. Improve this question I have … Read more

Using Docker-Compose, how to execute multiple commands

I want to do something like this where I can run multiple commands in order. db: image: postgres web: build: . command: python manage.py migrate command: python manage.py runserver 0.0.0.0:8000 volumes: – .:/code ports: – “8000:8000” links: – db 19 s 19 Figured it out, use bash -c. Example: command: bash -c “python manage.py migrate … Read more