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
1 answer

Why is docker looking in /simple for python packages?

I've been trying to get django to run via uwsgi in a docker container. I had django running in docker, with its built in web server, but now that I've modified the requirements.txt to include uwsgi, I keep getting the following error…
Matt Ellen
  • 11,268
  • 4
  • 68
  • 90
10
votes
1 answer

Installing psycopg2 in an alpine docker container

I am trying to get my django application to use PostgreSQL, however, so far no luck. I set the application to use the PostgreSQL database and linked both containers using docker-compose.yml, but I am getting the error that the module psycopg2 is…
Code4fun
  • 121
  • 1
  • 7
10
votes
4 answers

Docker Compose how to extend service with build to use an image instead

Having a base docker-compose.yml like the following: version: '2' services: web: build: . ... How can I extend it to use an image instead? docker-compose.prod.yml version: '2' services: web: image: username/repo:tag Running it with…
zurfyx
  • 31,043
  • 20
  • 111
  • 145
10
votes
1 answer

Docker Compose host path error with nginx

I've a error when I run docker-compose up nginx with my host path : ERROR: for nginx Cannot start service nginx: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused…
s-leg3ndz
  • 3,260
  • 10
  • 32
  • 60
10
votes
1 answer

Docker container communicating with external database

I am working on an application to move it to Docker. The application has a reverse proxy nginx sitting at the front that directs the calls to the the front end application. The front end application is then linked to a back end java application. At…
Asim
  • 543
  • 4
  • 20
10
votes
2 answers

Deploy a docker stack on one node (co-schedule containers like docker swarm)

I'm aware that docker-compose with docker-swarm (which is now legacy) is able to co-schedule some services on one node (using dependency filters such as link) I was wondering if this kind of co-scheduling is possible using modern docker engine swarm…
10
votes
2 answers

Run docker image with docker-compose

I have my simple app in C# that connect with postgreSQL. I would like to create image with this app and just run with docker. Everything is ok when I use: $ docker build $ docker run postgres $ docker run my_app Additionally, there is everything…
GrzesiekO
  • 1,179
  • 4
  • 21
  • 34
10
votes
1 answer

Docker Compose CLI Flags

I am not sure how to run the docker-compose equivalent of the following... docker run -d -p 8080:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer --logo…
TheJediCowboy
  • 8,924
  • 28
  • 136
  • 208
10
votes
3 answers

ERROR - Docker-compose/docker Windows

I wanted to deploy my application on a windows system. I recently (yesterday) installed DockerToolbox-1.12.4 on my windows 10. This gives my a new terminal. When I tried to deploy my projet with docker-compose up --build, I receive this massage:…
dmx
  • 1,862
  • 3
  • 26
  • 48
10
votes
1 answer

Docker - container started by docker-compose changing file ownership to root

I am starting six or seven containers via a docker-compose file. One container is causing a major problem! Here is the relevant section: services: ... main-app: image: mycompany/sys:1.2.3 container_name: "main-app-container" …
JoeG
  • 7,191
  • 10
  • 60
  • 105
10
votes
4 answers

How to deal with state "Exit 0" in Docker

I have build a Docker image and afterwards run a container using Docker Compose. The following command will do the job for me: docker-compose up -d I have restarted the PC and now I want to start the previous container that I've created before. So…
ReynierPM
  • 17,594
  • 53
  • 193
  • 363
10
votes
1 answer

docker-compose create mongo container with username and password

I have a mongo container being created in Compose: version: '2' volumes: mongodata: driver: local services: mongo: image: mongo:latest hostname: ${MONGODB_HOST} restart: always ports: - "27017:27017" volumes: …
amlwwalker
  • 3,161
  • 4
  • 26
  • 47
10
votes
3 answers

How can I pass a multi-line variable to a docker container?

According to this comment, multi-line variables are supported with docker compose: environment: KEY: |- line1 line2 However, when I execute echo $KEY in the container, it has replaced the newline with spaces: line1 line2 Am I missing…
giraff
  • 4,601
  • 2
  • 23
  • 35
10
votes
2 answers

Docker Official Tomcat Image Modify Server.xml and add jar to lib folder

I want to added MySQL jar file in lib folder and need to add some JNDI setting in server.xml file of tomcat conf folder of official tomcat docker image. But i am not sure how to make change to conf folder files of tomcat. I am using below…
Anchit Pancholi
  • 1,174
  • 4
  • 14
  • 40
10
votes
3 answers

docker-compose up : Encountered errors while bringing up the project

I am working on Ubuntu Mint 17.2 64-bit and installed Docker using installation guide. Getting problem while docker-compose up. When fire command it shows me error like : data is up-to-date db is up-to-date Starting web ERROR: for web Cannot start…
Jaymin Suthar
  • 155
  • 1
  • 2
  • 11