docker-compose

Linking django and mysql containers using docker-compose

假如想象 提交于 2019-12-18 14:53:16
问题 I've been following with the docker-compose tutorial here (linking django and postgres container). Although I was able to go through with the tutorial I'm however not able to proceed with repeating the same using a mysql container. The following are my dockerfile and docker-compose.yml ` db: image: mysql web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" links: - db:db ` dockerfile FROM python:2.7 RUN mkdir /code WORKDIR /code RUN pip

How to integrate Capistrano with Docker for deployment?

最后都变了- 提交于 2019-12-18 14:09:24
问题 I am not sure my question is relevant as I may try to mix tools (Capistrano and Docker) that should not be mixed. I have recently dockerized an application that is deployed with Capistrano. Docker compose is used both for development and staging environments. This is how my project looks like (the application files are not shown): Capfile docker-compose.yml docker-compose.staging.yml config/ deploy.rb deploy staging.rb The Docker Compose files creates all the necessary containers (Nginx, PHP,

Equivalent of volumes_from in Docker Compose v3

倖福魔咒の 提交于 2019-12-18 11:47:39
问题 There are seemingly similar questions here (docker-compose volumes_from equivalent with version 3, How to replace volumes_from in docker-composer v3) but I don't think they answer the question (or at least I don't understand how the answers solve the problem). So let me try to ask again, very specifically. I have this v2 docker-compose.yml: version: '2' services: full-tests: volumes: - ..:/opt/project - ../../../ext-libs:/opt/ext-libs - ./third-mapping:/opt/third unit-tests: volumes_from:

Limit resources in docker-compose v3

眉间皱痕 提交于 2019-12-18 11:45:59
问题 mem_limit is no longer supported in version 3 of docker-compose.yml file. The documentation tells that I should use the deploy.resources key instead but also that this part will only be effective with swarm or docker stack. cpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit: These have been replaced by the resources key under deploy. Note that deploy configuration only takes effect when using docker stack deploy, and is ignored by docker-compose. ... as written in the docs. How do I set

Running composer install within a Dockerfile

瘦欲@ 提交于 2019-12-18 11:08:33
问题 I'm trying to Dockerize my laravel app. The app is already built and in git, but I .gitignore my vendor folder. I've added a Dockerfile, which looks like this: FROM php:7.1-fpm-alpine RUN apk update && apk add curl && \ curl -sS https://getcomposer.org/installer | php \ && chmod +x composer.phar && mv composer.phar /usr/local/bin/composer RUN apk --no-cache add --virtual .build-deps $PHPIZE_DEPS \ && apk --no-cache add --virtual .ext-deps libmcrypt-dev freetype-dev \ libjpeg-turbo-dev libpng

Auto-reloading of code changes with Django development in Docker with Gunicorn

与世无争的帅哥 提交于 2019-12-18 10:32:44
问题 I'm using a Docker container for Django development, and the container runs Gunicorn with Nginx. I'd like code changes to auto-load, but the only way I can get them to load is by rebuilding with docker-compose ( docker-compose build ). The problem with "build" is that it re-runs all my pip installs. I'm using the Gunicorn --reload flag, which is apparently supposed to do what I want. Here are my Docker config files: ## Dockerfile: FROM python:3.4.3 RUN mkdir /code WORKDIR /code ADD . /code/

How should I backup & restore docker named volumes

落爺英雄遲暮 提交于 2019-12-18 10:22:15
问题 I'm a little bit confused with the functionnality of named volumes in a docker compose file specifically when it comes to backup/restore my app. I'm actually testing this dockercompose file : version: '2' services: django: build: context: "{{ build_dir }}/docker/django" depends_on: - db environment: [...] volumes: - code:/data/code - www:/var/www - conf:/data/conf networks: - front - db expose: - "8080" entrypoint: "/init" db: build: context: "{{ build_dir }}/docker/postgres" environment: [..

Docker-Compose can't connect to Docker Daemon

廉价感情. 提交于 2019-12-18 10:18:07
问题 I am getting an error message saying I can't connect to the docker daemon. I have looked into other people's answers who have had similar issues but it hasn't helped. I am running the version of Ubuntu 15.10. I will try to provide all the info I have. root@# docker-compose -f docker-compose-deps.yml up -d ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Docker Networking - nginx: [emerg] host not found in upstream

一世执手 提交于 2019-12-18 10:17:48
问题 I have recently started migrating to Docker 1.9 and Docker-Compose 1.5's networking features to replace using links. So far with links there were no problems with nginx connecting to my php5-fpm fastcgi server located in a different server in one group via docker-compose. Newly though when I run docker-compose --x-networking up my php-fpm, mongo and nginx containers boot up, however nginx quits straight away with [emerg] 1#1: host not found in upstream "waapi_php_1" in /etc/nginx/conf.d

Getting the name of the container from within the container

一笑奈何 提交于 2019-12-18 07:17:54
问题 I would like to get the docker container name from within a container. I need this information because I am running a script from the Dockerfile as an ENTRYPOINT that needs to know the node number. I am using the --scale with docker-compose to create a cluster of my image. I am able to get the hostname of the container which is the container ID. But is there a way to get the container name from inside the container? 回答1: Docker remote apis should work for you. Depending on the version of your