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.

184
votes
12answers
107k views

Docker Compose wait for container X before starting Y

I am using rabbitmq and a simple python sample from here together with docker-compose. My problem is that I need to wait for rabbitmq to fully started. From what I searched so far, I don't know how ...
46
votes
6answers
27k views

How do I seed a mongo database using docker-compose?

I am trying to distribute a set of connected applications running in several linked containers that includes a mongo database that is required to:be distributed containing some seed data;allow ...
75
votes
10answers
58k views

How to mount local volumes in docker machine

I am trying to use docker-machine with docker-compose. The file docker-compose.yml has definitions as follows:web:build: .command: http://stackoverflow.com/run_web.shvolumes:- .:/appports:- "8000:...
116
votes
11answers
44k views

Docker-compose: node_modules not present in a volume after npm install succeeds

I have an app with the following services:web/ - holds and runs a python 3 flask web server on port 5000. Uses sqlite3.worker/ - has an index.js file which is a worker for a queue. the web server ...
1
vote
1answer
2k views

How do I configure docker compose to expose ports correctly?

I'm using docker and docker compose to run a clojure and a node app, alongside postgres.The project is contained in the following folder structure.project/-- app/-- -- Dockerfile-- frontend/-- ...
118
votes
5answers
81k views

How to get docker-compose to always re-create containers from fresh images?

My docker images are built on a Jenkins CI server and are pushed to our private Docker Registry. My goal is to provision environments with docker-compose which always start the originally built state ...
127
votes
6answers
86k views

Interactive shell using Docker Compose

Is there any way to start a interactive shell in a container using Docker Compose only? I've tried something like this, in my docker-compose.yml:myapp:image: alpine:latestentrypoint: /bin/sh...
30
votes
5answers
23k views

Access docker container from host using containers name

I am developing a service and using there docker compose to spin services like postgres, redis, elasticsearch. I have a web application that is based on RubyOnRails and writes and reads from all those ...
268
votes
9answers
190k views

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: postgresweb:build: .command: python manage.py migratecommand: python manage.py runserver 0.0.0.0:...
112
votes
10answers
118k views

How to use environment variables in docker compose

I would like to be able to use env variables inside docker-compose.yml, with values passed in at the time of docker-compose up.This is the example. I am doing this today with basic docker run command,...
94
votes
7answers
51k views

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.ymlHow can I make sure that a container in front can send requests to a ...
38
votes
2answers
26k views

Docker Compose - Share named volume between multiple containers

I'm using docker-compose and v3. I'm trying to mount a volume in docker:http://stackoverflow.com/appdata:/appdataI'd like to have this as a volume and then reference that volume from multiple containers. The volume ...
4
votes
2answers
264 views

Why docker container name has an random number at the end?

I have a docker-compose.yml file as below (a piece of it):version: '3.5'services:framework:image: ${DOCKER_REGISTRY}/gme/fmk:${COMPOSE_PROJECT_NAME}build: http://stackoverflow.com/fmkports:- "...
1
vote
2answers
55 views

Connect to host A from docker running on host B

I develop distributed system and I consider situation:My application is working in docker that is running on host A and I want to call api from other service that is running on physical host B (...
96
votes
4answers
66k views

How to persist data in a dockerized postgres database using volumes

My docker compose file has three containers, web, nginx, and postgres. Postgres looks like this:postgres:container_name: postgresrestart: alwaysimage: postgres:latestvolumes:- http://stackoverflow.com/...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,