Questions tagged [docker-compose]

Compose is a tool for defining and running multi-container Docker applications.

Filter by
Sorted by
Tagged with
87 votes
5 answers
148k views

Configuring Docker to not use the 172.17.0.0 range

Due to problems with captive portals and the default Docker IP range I am trying to make Docker use the 198.18.0.0 range, instead of 172.17.0.0, which clashes with the captive portals used on the ...
jrtapsell's user avatar
  • 1,206
81 votes
1 answer
226k views

How does "restart: always" policy work in docker-compose?

I have docker compose file with PostgreSQL and my application, like this: version: '3' services: postgresql: image: postgres:9.6.6 ports: - 9932:5432 expose: - "5432" ...
Marcin Zablocki's user avatar
46 votes
12 answers
78k views

Check is container/service running with docker-compose

I am using the docker-compose. Some commands like up -d service_name or start service_name are returning right away and this is pretty useful if you don't want the containers running to depend on ...
Ivan Kolmychek's user avatar
46 votes
4 answers
90k views

How is Docker Compose version 2 "volumes" syntax supposed to look?

With Docker Compose v1.6.0+, there now is a new/version 2 file syntax for the docker-compose.yml file. The changes include a separate top level key named volumes. This allows to "centralize" volume ...
kaiser's user avatar
  • 1,251
29 votes
5 answers
16k views

Docker turn anonymous volume into named volume

I have tried out a docker image using the docker command line without specifying names for volumes. Now I found that I want to continue using this container/image but by defining the container in ...
freiheitsnetz's user avatar
22 votes
2 answers
33k views

How and where to configure pm.max_children for php-fpm with Docker?

In a Web application with Nginx and PHP-FPM, I've noticed moments of slowness and analyzing the logs, I found this message, which appears from time to time: [19-Nov-2017 19:24:09] WARNING: [pool www] ...
lfalmeida's user avatar
  • 323
19 votes
6 answers
98k views

Can not access mysql docker

I am using docker-compose to create mysql container. I get host IP 172.21.0.2. But when I connect mysql. I get error: My docker-compose.yml: version: '2' services: ### Mysql container mysql: ...
Quoc Dat's user avatar
  • 193
14 votes
2 answers
11k views

Force Ansible to log off to refresh user groups

I'm setting up a server with Ansible and Docker. I'm currently learning both technologies, so please bear with me if I'm being overly stupid here. In order to run run Docker commands, the user has to ...
MadMonkey's user avatar
  • 295
14 votes
4 answers
72k views

Why does docker-compose issue a "No such file or directory" when the file is there?

I am testing a bare metal recovery of my server which basically starts a set of docker container with my services. I recovered from a backup /etc/docker, where I keep all the configuration and ...
WoJ's user avatar
  • 3,617
13 votes
1 answer
22k views

Expose a Unix socket to the host system from inside from a Docker container

I would like to run aweb server inside a Docker container that listens to a Unix socket, instead of to a port. I'm finding a lot of results on sharing the Docker socket, but I don't think that's what ...
Drazisil's user avatar
  • 270
13 votes
2 answers
8k views

Can not stop tzdata asking for user input during docker-compose build

I've tried several things including ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Lnndon RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone But whatever I ...
Ben Edwards's user avatar
12 votes
3 answers
33k views

"docker-compose up" as root user or non-root user?

After reading some articles I'm still not sure about what user I should use to run a docker container. Are there any security concerns when running a docker container as root user? Is it ok to run ...
r00tusr's user avatar
  • 191
11 votes
5 answers
14k views

Is there any way to run Postfix in foreground?

Is there any way to run Postfix in foreground? I want to run Postfix as PID 1 in docker. I don't want to use any bash shell, supervisorD, or any wrapper to start it. I just want to know if there is ...
Farhan's user avatar
  • 4,289
11 votes
2 answers
12k views

docker-compose for nginx and nodejs server

I have the following docker-compose.yml file: version: '3' services: server: build: context: ../../ dockerfile: ./packages/website/Dockerfile command: node ...
dagda1's user avatar
  • 247
11 votes
3 answers
30k views

How do I give a docker container its own routable IP on the original network?

Main question Imagine this scenario. A network of 192.168.0.0/24. A computer with hostname 'Docker-Host' is running a docker engine at 192.168.0.2 'Docker-Host' has sshd server running On 'Docker-...
TrevorKS's user avatar
  • 263
11 votes
1 answer
6k views

How to do docker-compose down without the config file that made the up?

When you do docker-compose up, it's based on a docker-compose.yml file. This usually brings up a network, builds and runs multiple services. If you do the up with the -d flag, the docker-compose ...
Xavi Montero's user avatar
10 votes
2 answers
24k views

What are proper iptables Rules for Docker Host?

I have Ubuntu server with Docker to serve MySQL and SSH/SFTP and I need all ports except 3306 and 22 to be firewalled, pretty standard and trivial requirement, right? Now, I managed to find a sort of ...
dzhi's user avatar
  • 820
9 votes
3 answers
31k views

nginx and php-fpm: "Primary script unknown" while reading response header from upstream

I want pass any api/* route to php-fpm. Specifically to index.php as I use Symfony. This is the only route that should use php. Anything else will be loaded from /usr/share/nginx/html/public (just ...
BugHunterUK's user avatar
9 votes
2 answers
15k views

Configure php-fpm to access environment variables in docker

I'm running php7-fpm in a docker container. However my php scripts aren't able to access environments variables set in my docker-compose file. getenv('MY_ENV_VAR') returns FALSE. I've changed /etc/...
Aidan Ewen's user avatar
9 votes
1 answer
6k views

connection between two docker containers of two stacks

I am building on two projects which share some common data. The services of the two projects are built from two docker-compose YML files. I want to access the MySQL server specified in one stack from ...
ロジャー's user avatar
9 votes
1 answer
10k views

How to prevent docker containers auto-start at daemon start in Windows? [closed]

I am using Docker and its docker-compose functionalities on Windows 10. Right now when I run the command docker-compose up -d to start some containers in the background, the containers started will ...
Octavian's user avatar
  • 211
8 votes
2 answers
13k views

Where is docker volume stored in the host computer for docker-compose?

Consider the following docker-compose file version: "2" services: postgres: image: postgres:9.6 volumes: - ./vol_folder:/var/lib/postgresql ports: - "5432:5432" Here is my ...
kevP's user avatar
  • 81
8 votes
3 answers
39k views

CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team

I'm trying to run docker-compose (which was installed via pip), yet running into following error: # pip install --quiet docker-compose # docker-compose ps /usr/local/lib/python2.7/dist-packages/...
alexus's user avatar
  • 13.2k
8 votes
2 answers
6k views

How to prevent docker-compose appending hashes to created container names?

I have a server with several lxc containers. In some of the containers there is a docker installed. Usually a docker compose action in these LXC containers results in container names with the format ...
simonszu's user avatar
  • 373
8 votes
1 answer
9k views

How to forward Docker container logs to ELK?

I would like to know what is the easiest way to forward my docker container logs to an ELK server, so far the solutions I have tried after having searched the internet didn't work at all. Basically ...
ndarkness's user avatar
  • 193
7 votes
2 answers
35k views

Docker + Nginx + PHP-FPM error: [emerg] 1#1: host not found in upstream [closed]

I have a docker setup for LEMP stack that I cloned from this repo. Everything works nicely on my development machine running window 10, but when I push the image to docker hub and pull it on my VPS ...
samayo's user avatar
  • 287
7 votes
1 answer
3k views

WEBRTC MCU/SFU inside kubernetes - Port Ranges?

I am using janus-gateway as a webrtc media server for group videocalling. Previously I had deployed it in a single node using docker-compose but now I want to be able to scale it horizontally. For ...
Abdul Basit's user avatar
7 votes
4 answers
22k views

Using iptables rules aren't working with Docker container

Just set up an ElasticSearch container to use with company's Laravel app. Creating docker-compose.yml and running it is flawless and straight-forward but the issue occurs when I want to firewall this ...
dzhi's user avatar
  • 820
6 votes
2 answers
17k views

EC2 Instance Freezes

I am experiencing sudden freezes in one particular instance. Here some details of the instance: Type: t2.micro Region/av. zone: us-west-2b OS: amzn-ami-hvm-2018.03.0.20180811-x86_64-gp2 (ami-a0cfeed8) ...
Ashok Patel's user avatar
6 votes
2 answers
33k views

Why is there no php.ini file when I install PHP in a docker container?

I'm using docker-compose to setup a minimal nginx + php-fpm application but for some reason there is no php.ini file on the docker container (I know because phpinfo() says Loaded Configuration File: (...
skb's user avatar
  • 93
6 votes
1 answer
12k views

docker-compose exec composer as user

I have a docker-compose setup working perfect on my local machine for my symfony projects with nginx, php7-fpm and mysql. I often need to install new packages via composer, so I just deliver the ...
sh4's user avatar
  • 241
6 votes
1 answer
2k views

How to secure a docker host to not allow rooting

I am trying to make docker on a server more secure. The main problem is that most people say "if a person has access to docker, they can be root too" for an administrator point of few this is not ...
Erik-Jan Riemers's user avatar
6 votes
0 answers
6k views

Is there a way to flush docker's embedded dns cache?

I'm working in an environment where sometimes the DNS server flakes out and tells you it can't resolve a host (eg. lookup of "github.com" fails). It's transient, and usually recovers fairly quickly. ...
rascalking's user avatar
5 votes
2 answers
16k views

set time period to restart a container with docker-compose

how would you do to restart the container service every 60 seconds I tried sleep but it doesn't work for me: spark: image: jaegertracing/spark-dependencies environment: - STORAGE=...
user avatar
5 votes
2 answers
21k views

nginx can't find /etc/letsencrypt/options-ssl-ngin.conf file

I'm trying to serve a python-django webapp using a linux box (running ubuntu 18.04) with nginx, gunincorn, letsencrypt and docker. After following a number of online tutorials I have been successful ...
Matt Ellis's user avatar
5 votes
1 answer
9k views

nginx won't serve json file unless specifying .json in url

I have the following nginx.conf file: server { listen 8080; server_name dummy_server; root /usr/share/nginx/html; location / { if ($request_method = 'OPTIONS') { ...
ran's user avatar
  • 53
5 votes
1 answer
4k views

Podman: Method to convert docker-compose files to systemd unit files

I'm migrating away from docker towards podman (not going straight for kubernetes, as that would definitely be overkill at this point). Now, many an elegant configuration can be had as docker-compose ...
Marcus Müller's user avatar
5 votes
1 answer
46k views

How do I access nginx server logs from within Docker?

I have Nginx routing requests from the browser to either the Express API or my react server, however, in the console I continue to get xhr requests that are just pending and then timeout with 502 bad ...
Daniel's user avatar
  • 229
5 votes
2 answers
4k views

How to forward application logs from Docker containers to ELK

I'm trying to centralise logging in an environment that using multiple application technologies (Java, Rails and various DBs). We want to developers to bring up stacks with Docker Compose, but we ...
Garreth McDaid's user avatar
5 votes
0 answers
6k views

docker-compose `restart: always` randomly not working

I administer a few Debian servers with Docker CE installed and docker-compose orchestrating several services (roughly 20 containers per machine).. Every single service is configured with restart: ...
adamsfamily's user avatar
4 votes
3 answers
15k views

Docker Compose returns error "networks have overlapping IPv4"

starting by saying I am totally new to Docker and I am not yet familiarized with the Docker ecosystem. What I try to perform is to create a docker-composer.yml to be used in my local dev environment ...
KodeFor.Me's user avatar
4 votes
2 answers
23k views

Docker based reverse proxy with NginX for multiple domains

I'm trying to create a docker based multi-container setup with a reverse proxy for multiple domains to serve, where the websites, the databases and the nginx based reverse proxy run in containers, but ...
elaspog's user avatar
  • 223
4 votes
3 answers
13k views

Docker PostgreSQL change database encoding to UTF-8

I want to run via docker-compose a postgres container which has COLLATE and CTYPE 'C' and database encoding 'UTF-8'. But this looks to be impossible. This is the part on the docker-compose.yml: ...
Philipp's user avatar
  • 123
4 votes
1 answer
3k views

Error: could not determine PostgreSQL version from '11.7'

I found a Django project and failed to get it running in Docker container in the following way: git clone https://github.com/hotdogee/django-blast.git I have the following Dockerfile: FROM python:2 ...
user977828's user avatar
4 votes
1 answer
991 views

Why isn't firewalld filtering the services running in my Docker containers?

My services were filtered correctly after migrating from iptables to firewalld and updating the rules with firewall-cmd. Then I moved all services to containers using Docker, and ran everything with ...
Ken - Enough about Monica's user avatar
4 votes
3 answers
8k views

configure minio in docker to use https

This is my docker-compose.yml: version: '3.7' services: minio: image: minio/minio command: server -C /etc/minio --address ":9000" --console-address ":9001" /data ...
Felix D.'s user avatar
  • 143
4 votes
1 answer
11k views

Nginx Docker container always restarting

My current docker-compose.yml looks like this: version: '3' services: testsite-nginx: image: nginx:alpine container_name: test_site_nginx restart: unless-stopped ...
Jaquarh's user avatar
  • 191
4 votes
2 answers
5k views

Setup wordpress container in subdirectory with nginx and mariadb

Ok guys here is the problem: i have my webserver serving a website, a cms and mobile app api using a subdirectory approach like this localhost -> site localhost/cms localhost/api everything is ...
javal88's user avatar
  • 143
4 votes
1 answer
681 views

Docker bridge network shadows IP of SSH client, how to recover gracefully?

We're running a RHEL 7 VM with Docker to host a couple of internal services. Last time I ran docker-compose up to spin up a new Docker container, I lost my SSH connection to the server and could also ...
Martin Wurm's user avatar
4 votes
1 answer
6k views

How to move docker-compose containers stack to another host

I have a project running on a host using docker compose. Can anyone advise me on how can I move the docker-compose containers to another host?
Rama Krishna S's user avatar

1
2 3 4 5
13