Questions tagged [docker-compose]

1

votes
2

answer
1.4k

Views

Docker-compose tutorial not working “python: can't open file 'manage.py”

I am running simple Docker-compose example shown here Here is Dockerfile: FROM python:2.7 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ Here is docker-compose.yml: version: '2' services: db: image: postgres web: buil...
Alexander Tyapkov
6

votes
2

answer
493

Views

How to start service only when other service had completed?

Using compose I want to start a service only after another service has exited with code 0. I have mutiple needs for this functionality. The basic need is where I have: database service database migration service application service The database service will start an empty database. My app needs it's...
Robert3452
1

votes
2

answer
259

Views

What would the deploy.sh file look like for Gitlab CI?

In the Docker registry docs on the gitlab Site they give an example where the deploy stage has: deploy: stage: deploy script: - ./deploy.sh only: - master What would the deploy.sh file look like? In either pseudo code or real code.
1

votes
1

answer
2.3k

Views

Saving mongodb on volume using docker-compose

In my project I have few container managed by docker-compose. I would like to store data from mongoDB on persistent volume. MongoDB seems to store data in /data/db but files are not transferred to my host file system and they disappear after rebuilding container. Here is my docker-compose config fi...
plewa1a2a3a
1

votes
1

answer
302

Views

Running gulp in Docker compose - does not create files

I have issues where gulp is not making any files. It says finished, but no file is being created. If I log in to my docker instance using: docker exec -t -i myservice-service /bin/bash and if I run the gulp command, then it creates it properly Then all the files defined in the gulpfile.js are creat...
1

votes
1

answer
842

Views

docker ERR_NAME_NOT_RESOLVED http ajax

I have 3 simple microservices (mysql, apirest, gui) that I start using docker-compose: version: '3.2' services: mysql: image: mysql/mysql-server:5.6 container_name: mysql restart: always volumes: - mysql:/var/lib/mysql/data ports: - "3306:3306" networks: - mynetwork deploy: mode: replicated replicas...
Fabry
1

votes
1

answer
66

Views

Starting only one service from a compose file with DockerComposeContainer

Is that possible somehow to run only specific services? Taking the official documentation: https://github.com/testcontainers/testcontainers-java/blob/master/docs/usage/docker_compose.md In the example above could we just start say redis? For me all the services start all the time( and it doesnt mat...
beatrice
1

votes
2

answer
211

Views

dockerhub automated build from single repo with single dockerfile building multiple images

I have a single git repository on github with: a Dockerfile which builds multiple images meant to be used together. (a maven build produces a war file and sql files by downloading then from artifact repositories; a multi-stage build then creates a slim tomcat image with the war and a slim mysql imag...
jonenst
1

votes
1

answer
543

Views

How to get proper docker-compose Multiline environment variables formatting?

I made a docker-compose.yaml for my Wordpress stack using official Wordpress image and I want to add some custom constants in wp-config.php file automatically. By following official image instructions I end up with this: ### Web Application wordpress: container_name: 'wordpress' image: 'wordpress:ph...
dzhi
1

votes
1

answer
162

Views

Docker-compose: how to do version 2 “mem_limit” in version 3?

Recently, I tried upgrading a version 2 docker-compose yaml file to version 3. Specifically, I was going from 2.1 to 3.4. Using docker-compose version 1.18.0 and docker version 18.06.01. The first attempt caused docker-compose to abort because of the presence of the Version 2 option: mem_limit. R...
JoeG
1

votes
1

answer
86

Views

Docker running the containers and modifying environment settings

Set up is on a Ubuntu 18.10 x64 Trying to set up a set up a Laravel, Nginx, and MySQL droplet with Docker Compose, with this tutorial docker tutorial and I get all the way to step 8 in the tutorial where it asks me to run this command $ docker-compose exec app nano .env and it gives me an error of...
whisk
1

votes
2

answer
49

Views

docker-compose connecting to other container fails

I have two docker images, one rest server (flaskapp) and another web server (web). I am trying to run them using docker-compose. However, it seems that the web container is not able to contact the rest container Following is my docker-compose.yml file: version: '3' services: flaskapp: build: ./rest...
Gaurang Shah
0

votes
0

answer
6

Views

Mount single file from volume using docker-compose

For local dev I need to mount a different config file in a Docker container. This is easy with the command line -v $(pwd)/bla.yaml:/location/bla.yaml. Is it possible to do this from a volume an a docker-compose file?
Jason Leach
10

votes
2

answer
304

Views

Python multiprocessing crashes docker container

There is simple python multiprocessing code that works like a charm, when I run it in console: # mp.py import multiprocessing as mp def do_smth(): print('something') if __name__ == '__main__': ctx = mp.get_context("spawn") p = ctx.Process(target=do_smth, args=tuple()) p.start() p.join() Result: > $...
ilalex
1

votes
0

answer
4

Views

docker-compose ERROR: Cannot locate specified Dockerfile

I have a .Net Core project that I want to deploy production environment but when I try to build it on my droplet I get this error "ERROR: Cannot locate specified Dockerfile". I couldn't figure out what's wrong with my configurations. Project Structure project │ project.sln │ docker-compose.d...
Ali Coşkun
1

votes
1

answer
8

Views

How to mount a file to a docker/compose container?

I want to deploy a few containers to a GCE VM created using GCP Container-Optimized OS image using my existing compose yaml file on GCP. One of the container needs a file from the host. With Container-Optimized OS instance, based on the tutorial from https://cloud.google.com/community/tutorials/dock...
JerryL
0

votes
0

answer
2

Views

Traefik two frontends on one backend different ports

I'm running traefik 1.7.8 and created a container via docker-compose with following labels and frontend rules: labels: - "traefik.enable=true" - "traefik.data.frontend.rule=Host:data.${DOMAINNAME}" - "traefik.data.port=324" - "traefik.data.protocol=http" - "traefik.webtools.frontend.rule=Host:webtoo...
user3570449
1

votes
2

answer
8.8k

Views

How to link two containers using docker-compose

At the moment I have two containers which I build from an image and then link the two: For example: #mysql docker build -t my/mysql docker-mysql docker run -p 3306:3306 --name mysql -d my/mysql:latest #webapp docker build -t my/tomcat:7.0 tomcat/7.0 docker run -d --link mysql --name tomcat7 my/tomca...
Omnipresent
6

votes
2

answer
76

Views

docker-compose restart policy - disable exponential delay between restarts

I've a docker-compose file configuring a service with the restart policy set to always The command is python3 script.py And script.py just prints the current timestamp : import time print(time.time()) Using docker-compose up I get this : random_service | 1546974860.1233172 random_service | 154...
Loïc
1

votes
1

answer
841

Views

Docker MySQL: Connecting a Rails app to MySQL

I have a rails app that I'm running in Docker. I want to run MySQL in a separate container and connect the two. My docker-compose.yml file looks like this: # docker-compose.yml db: image: "mysql:5.6" ports: - 3306 environment: MYSQL_ROOT_PASSWORD: pass MYSQL_DATABASE: dbname MYSQL_USER: user MYSQL_...
JVG
1

votes
2

answer
1k

Views

Flush Flower database occasionally and/or exit gracefully from Docker?

I'm running Celery Flower in Docker (see this question for details). The command ends up being: celery -A proj flower --persistent=True --db=/flower/flower I've got a persistent volume all set up on /flower. However, it looks like Flower never writes anything to its database file, even after 30 minu...
Claudiu
1

votes
0

answer
5

Views

How to connect two SCS and a proxy server via a docker-compose.yml file?

We have a project that we have to build two self contained systems - Persons and Projects (some groups have to implement the persons and the others implement the projects- we have to implement the person). For each there is a separate data bank and they have to exchange information with each other....
Liat Khitman
1

votes
1

answer
6

Views

Copy of existing wordpress site returns 302 in Docker Windows

I'm a WP noob but have to fix some bugs on an existing wp site. I don't want to do that on the live environment, so I try to mirror it in docker (apache, php, mysql...all with similar versions like on the live environment). I copied all php from their ftp migrated the mysql data When I access this l...
andymel
1

votes
1

answer
497

Views

kafka override advertised.host.name in client java

we have kafka 0.8.2.1 running on a single docker container. This is one of several containers set up to work together with docker compose. The docker compose also exposes the kafka 9092 port to the host machine. The advertised.host.name of the kafka server is set to kafka and all the other container...
Sodved
1

votes
1

answer
8.3k

Views

ERROR: repository x not found: does not exist or no pull access

I'm getting the below error message when doing a docker-compose up: ERROR: repository phusionphp not found: does not exist or no pull access However I have built this image with docker build -t phusionphp:7.0 . I am able to run this directly using sudo docker run -it --rm phusionphp:7.0: *** Running...
0

votes
2

answer
12

Views

How to generate a image from a Dockerfile

I have a very old project im giving suport. Im using docker to make my builds and everything was working until this last one try. This is my Dockerfile: FROM ruby:2.1 # Install apt based dependencies required to run Rails as # well as RubyGems. As the Ruby image itself is based on a # Debian ima...
Fernando Maymone
1

votes
1

answer
968

Views

Can't connect to php7 fpm docker container from within an apache 2 docker container

Similar question have been asked many times and I have gone through most of them and still I am not able to solve the problem. I am running Apache2 and PHP 7 FPM in different docker containers and they are not able to connect to each other. The connection fails with following errors. [Tue Sep 19 0...
1

votes
1

answer
2.9k

Views

Using external config in spring boot application within docker-compose

I've got a spring boot application which uses com.spotify.dockerfile-maven-plugin to build a docker image of my application org.rtu/some-importer My docker-compose.yml is: version: '3' services: some-importer: image: org.rtu/some-importer build: . zookeeper: image: wurstmeister/zookeeper ports: - "2...
Roman T
1

votes
1

answer
693

Views

Is it possible to limit Traefik to the current (docker-compose) Stack?

Objective I have a server running Rancher (Docker). In that server, I have several un-related stacks. I want to make Traefik the main interaction point of that stack. And make it load balance / proxy the requests to different containers based on the path. I want to make it send the traffic for /api...
Sebastián Ramírez
1

votes
2

answer
1.8k

Views

docker-compose: container timezone

I'm using Docker Compose to run my stack in my dev environment, but I'm having issues with the timezone in the container being one hour behind my own timezone, breaking mission-critical things and making development very difficult. I figured this would be a common issue, so I've searched far and wid...
1

votes
1

answer
498

Views

How properly deploy Docker Compose to Amason EC2 instance?

I'm having docker-compose config with postgres, 2*python, nginx and redis services. Now I'm instantiated an ec2 instance and successfully logged in via .pem file. But I expected, that I can deploy my docker-compose image only with aws-cli commands. My question is should I instantiate ec2 for each of...
Vassiliy Vorobyov
1

votes
0

answer
10

Views

Golang test with external package dependency isn't passing with Gitlab Ci, but pass in local

I have test: package misc var ( Trace *log.Logger Info *log.Logger Warning *log.Logger Error *log.Logger ) func TestFTPGetFilesFromServer(t *testing.T) { misc.InitLogger(4) } with InitLogger is located in another package func InitSimpleLogger(level int) { if level == 1 { Trace = log.New(iout...
Juliatzin del Toro
1

votes
1

answer
2.1k

Views

Volume mount when setting up Wordpress with docker

Quickstart: Compose and WordPress proposes the following docker-compose.yml version: '3.3' services: db: image: mysql:5.7 volumes: - dbdata:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: somewordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpre...
tgogos
1

votes
1

answer
790

Views

use image-file in docker-compose file

I have to deliver an application running in several containers to a customer. I can export all single images to files with docker save --output app1.tar app2 docker save --output app2.tar app2 ... My goal is do deliver a ZIP-folder with only the docker-compose.yml and the images (app1.tar,app2.tar.....
Paul Oskar Mayer
1

votes
2

answer
52

Views

Can Docker images be “built” (“compiled”) to not require Docker?

I have a very small amount of experience with Docker for experimentation and development, and zero experience with Docker when it comes to staging and deployment - so forgive anything that sounds naive. The main question Suppose I have a Docker image (or even a docker-compose.yml file consisting of...
stevendesu
1

votes
1

answer
469

Views

Use docker-compose with port mapping for local Kafka testing

I'm trying to get the infrastructure for a black box service test up and running using docker-compose. I want to do that on Jenkins, for multiple services, therefore it is necessary to bind to build-specific port (e.g. 50012 instead of 9092) for the build should be able to run in parallel. The probl...
Michael
1

votes
1

answer
739

Views

Recommended RAM ratios for ELK with docker-compose

I have a production server with 8GB RAM. Im looking to host elastic,logstash and kibana on the server. Using documer compose. What would be the recommended java sizes memory sizes for each of the containers. How might I configure this. My docker-compose looks like the following --- version: '3' se...
Robbo_UK
1

votes
2

answer
232

Views

Spring Boot REST app returns 400 when requested from other docker-compose service by service name

I'm trying to introduce a Spring Boot REST service in our development setup. The development setup is using docker-compose and an API gateway to expose the individual services on the same domain (ie. localhost). When I try to make a HTTP request to my service from inside another container via the s...
Morten Olsen
1

votes
1

answer
413

Views

Can't add persistent folder to bitnami/mongodb on windows

I think this might be related to file system incompatibility (nfts/ext*) How can I compose my containers and persist the db without the container exiting? I'm using the bitnami-mongodb-image Error: Error executing 'postInstallation': EACCES: permission denied, mkdir '/bitnami/mongodb' mongodb_1 exit...
Tom M
1

votes
1

answer
626

Views

Unable to mount a file with docker-compose

I run docker-compose -f docker-compose.prod.yml up and I immediately get the error: ERROR: for frontend Cannot start service frontend: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"rootfs_linux.go:58: mounting \\\...
BugHunterUK

View additional questions