Questions tagged [docker-compose]

Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.

Docker Compose is an officially supported tool to build multi-container applications. An application author or deployer creates a YAML file, generally named docker-compose.yml, that lists the containers or services that make up the application, along with other Docker-specific resources such as named volumes or containers. Docker Compose supports some features of , though it also works well for single-host Docker installations.

This tag is appropriate for questions about setting up the docker-compose.yml file and other questions about deployment or communication between containers managed by Docker Compose. It may be appropriate to tag your questions as as well. Please include a good extract of the docker-compose.yml file as a code block in your question, enough to reproduce the issue you are asking about.

Remember that questions must be programming-related. Questions on how to install Compose, how to use Compose to manage existing prebuilt images, or how to run someone else's Compose file are not programming-related and are not on topic for Stack Overflow.

Key links:

30464 questions
10
votes
3 answers

Dockerize existing Django project

I can't wrap my head around how to dockerize existing Django app. I've read this official manual by Docker explaining how to create Django project during the creation of Docker image, but what I need is to dockerize existing project using the same…
Stan Reduta
  • 3,292
  • 5
  • 31
  • 55
10
votes
3 answers

Docker Swarm, Kubernetes and Compose

I just heard of the native Kubernetes support in the future Docker version. I never used Kubernetes before, so I started reading about it. But I got a little bit confused: Kubernetes is described as orchestration tool and also as an alternative to…
Munchkin
  • 4,528
  • 7
  • 45
  • 93
10
votes
1 answer

Docker + NGINX, how can I copy the configuration file from host to container?

This is my basic NGINX setup that works! web: image: nginx volumes: - ./nginx:/etc/nginx/conf.d .... I replace the volumes by copying ./nginx to /etc/nginx/conf.d using COPY ./nginx /etc/nginx/conf.d into my container. The issue was…
notalentgeek
  • 4,939
  • 11
  • 34
  • 53
10
votes
1 answer

How do I use DataGrip to access a PostgreSQL instance behind a Docker virtual network?

I have dockerized database microservices. I can run manual queries using the following: $ ssh user@foo.domain.com $ docker exec -it postgres bash docker$ psql -U postgres -h 127.0.0.1 -d postgres The web services all talk to one another using a…
Jack Murphy
  • 2,952
  • 1
  • 30
  • 49
10
votes
1 answer

docker swarm: share a network between stacks without external

I am deploying multiple stacks on a Docker swarm with docker compose. Right now I have defined a network in my proxy stack compose file: networks: proxy: driver: overlay The other stacks reference this network the following way: networks: …
herm
  • 14,613
  • 7
  • 41
  • 62
10
votes
3 answers

WARNING: no logs are available with the 'none' log driver

I am following below url for logging driver https://docs.docker.com/engine/admin/logging/overview/#configure-the-default-logging-driver now, I want to remove this logging driver I have remove file(daemon.json) from /etc/docker folder too. But when I…
Niko Jojo
  • 1,204
  • 2
  • 14
  • 31
10
votes
4 answers

npm ERR! missing script: start error with Docker

When running docker-compose to launch my app, I'm getting a npm ERR! missing script: start despite having a start script specified. package.json is { "name": "myapp", "version": "0.0.0", "private": true, "scripts": { "start": "node…
mcansado
  • 2,026
  • 4
  • 25
  • 39
10
votes
4 answers

initdb: could not change permissions of directory on Postgresql container

I am new to the docker ecosystem and I am trying to spin up a simple postgres container along with a volume so it persists its data, by using a yaml composer file. The file is as follows: # Use postgres/example user/password credentials version:…
arielnmz
  • 8,354
  • 9
  • 38
  • 66
10
votes
1 answer

Get list of containers/services of docker-compose from inside a container

There is a smart way to get the list of services (or containers) of docker-compose files from inside of a container. I would prefer not to using volumes, or passing statically the compose-file to container and parse it or pass a list with these…
10
votes
4 answers

Docker compose postgresql service - can't create user and database during build?

I have wasted an entire day on this, and to say I'm not impressed by the unnecessary complexity of what should be a simple task - would be a gross understatement. Ok, having got that off my chest, I am building a django application using…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
10
votes
2 answers

Error mounting a config file into the container

Edit: I'm on windows. I am experimenting with docker-compose. I know that I should use a Dockerfile to copy a file into the container, but I want to solve it by mounting the file because that is easier at the moment for my experiments. I also want…
Daniel
  • 3,092
  • 3
  • 32
  • 49
10
votes
3 answers

Visual Studio 2017 stopped running docker-compose

In Visual Studio 2017 I am working on a project with 3 dotnet core projects. It was building and starting the containers using docker-compose as the startup project. Now it is giving me an error that it cannot find the container starting with a…
CarBar
  • 145
  • 2
  • 7
10
votes
7 answers

docker-compose gives error "ImportError: No module named ssl_match_hostname" when run as normal user

I've installed docker-compose with 'pip2.7 install docker-compose" but when I try to run it as 'normal' user I get the following error message: mike@hugin:~/Tobedeleted$ docker-compose -v Traceback (most recent call last): File…
Swedish Mike
  • 583
  • 1
  • 8
  • 23
10
votes
1 answer

Docker is not creating new container but recreates running one

so I have the following problem. I'm using docker-compose to build and start two container. I did this multiple times with different docker-compose.yml files (image and container name differ) and it worked fine and three container run parallel. The…
kinglite
  • 339
  • 3
  • 20
10
votes
1 answer

docker-compose restart interval

I have a docker-compose.yml file with a following: services: kafka_listener: build: . command: bundle exec ./kafka foreground restart: always # other services Then I start containers with: docker-compose up -d On my amazon instance…
nattfodd
  • 1,790
  • 1
  • 17
  • 35