docker-compose

Symfony server:run in php Docker container

≯℡__Kan透↙ 提交于 2019-12-20 20:24:27
问题 I have a php docker container where is my symfony project. Here is my docker-compose.yml php-fpm: build: ./php container_name: php-fpm links: - db ports: - 9000:9000 - 8448:8448 - 8000:8000 working_dir: /var/www/html/ volumes: - ../app:/var/www/html volumes_from: - data tty: true env_file: - ./docker.env entrypoint: /entrypoint.sh I want to launch my symfony project with this command: php bin/console server:run localhost:8000 But it's not working when I want to access the url. I have this

Docker快速入门——Docker-Compose

拈花ヽ惹草 提交于 2019-12-20 20:02:23
Docker快速入门——Docker-Compose 一、Docker-Compose简介 1、Docker-Compose简介 Docker-Compose项目是Docker官方的开源项目,负责实现对Docker容器集群的快速编排。 Docker-Compose将所管理的容器分为三层,分别是工程(project),服务(service)以及容器(container)。Docker-Compose运行目录下的所有文件(docker-compose.yml,extends文件或环境变量文件等)组成一个工程,若无特殊指定工程名即为当前目录名。一个工程当中可包含多个服务,每个服务中定义了容器运行的镜像,参数,依赖。一个服务当中可包括多个容器实例,Docker-Compose并没有解决负载均衡的问题,因此需要借助其它工具实现服务发现及负载均衡。 Docker-Compose的工程配置文件默认为docker-compose.yml,可通过环境变量COMPOSE_FILE或-f参数自定义配置文件,其定义了多个有依赖关系的服务及每个服务运行的容器。 使用一个Dockerfile模板文件,可以让用户很方便的定义一个单独的应用容器。在工作中,经常会碰到需要多个容器相互配合来完成某项任务的情况。例如要实现一个Web项目,除了Web服务容器本身,往往还需要再加上后端的数据库服务容器

How to specify an iterator in the volume path when using docker-compose to scale up service?

亡梦爱人 提交于 2019-12-20 19:45:14
问题 Background: I'm using docker-compose in order to place a tomcat service into a docker swarm cluster but I'm presently struggling with how I would approach the logging directory given that I want to scale the service up yet retain the uniqueness of the logging directory. Consider the (obviously) made up docker-compose which simply starts tomcat and mounts a logging filesystem in which to capture the logs. version: '2' services: tomcat: image: "tomcat:latest" hostname: tomcat-example command:

How to specify an iterator in the volume path when using docker-compose to scale up service?

蹲街弑〆低调 提交于 2019-12-20 19:45:01
问题 Background: I'm using docker-compose in order to place a tomcat service into a docker swarm cluster but I'm presently struggling with how I would approach the logging directory given that I want to scale the service up yet retain the uniqueness of the logging directory. Consider the (obviously) made up docker-compose which simply starts tomcat and mounts a logging filesystem in which to capture the logs. version: '2' services: tomcat: image: "tomcat:latest" hostname: tomcat-example command:

Docker - Execute command after mounting a volume

情到浓时终转凉″ 提交于 2019-12-20 19:07:11
问题 I have the following Dockerfile for a php runtime based on the official [php][1] image. FROM php:fpm WORKDIR /var/www/root/ RUN apt-get update && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng12-dev \ zip \ unzip \ && docker-php-ext-install -j$(nproc) iconv mcrypt \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install -j$(nproc) gd \ && docker-php-ext-install mysqli \ && docker-php-ext

Docker - Execute command after mounting a volume

假如想象 提交于 2019-12-20 19:07:01
问题 I have the following Dockerfile for a php runtime based on the official [php][1] image. FROM php:fpm WORKDIR /var/www/root/ RUN apt-get update && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng12-dev \ zip \ unzip \ && docker-php-ext-install -j$(nproc) iconv mcrypt \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install -j$(nproc) gd \ && docker-php-ext-install mysqli \ && docker-php-ext

Running multiple Dockerize projects at the same time using PHP, MySQL, nginx

戏子无情 提交于 2019-12-20 15:32:32
问题 Problem I have projects with docker-compose configuration with same configuration (PHP, MySQL, nginx). When I run one project with docker-compose up there is not a problem, but I need to switch between them to few times per day for development. The problems: the share configurations for same port for nginx share configuration for default DB and connection (name and users) domains for each project I have Docker for Mac - edge For now Right now simply run up and down -v each time. Mostly,

Importing self-signed cert into Docker's JRE cacert is not recognized by the service

社会主义新天地 提交于 2019-12-20 10:41:11
问题 A Java Service is running inside the Docker container, which access the external HTTPS url and its self-sign certificate is unavailable to the service/ JRE cacert keystore and therefore connection fails. Hence imported the self-signed certificate of HTTPS external URL into Docker container's JRE cacert keystore. (after checking the $JAVA_HOME env. variable) Restarted the Docker container (using docker restart command), hoping that the service is also get restarted and pick the changes from

Using Docker-Compose to spin up multiple instances of a container with different configurations

女生的网名这么多〃 提交于 2019-12-20 10:24:11
问题 I understand that you can user docker-compose with the scale command to spin up multiple containers. However, they will all have the same configuration used. Is it possible to launch a container on the same host with different configurations (different .yml files) on the same host? Using the following commands: docker-compose -f dev.yml up -d docker-compose -f qa.yml up -d only the qa.yml container will be running, which is not what I want. -- edit -- Here's what happens when I try running

How to reload environment variables in docker-compose container with minimum downtime?

两盒软妹~` 提交于 2019-12-20 10:16:14
问题 docker-compose.yml version: '2' services: app: build: context: . command: python src/app.py restart: on-failure depends_on: - db environment: - TJBOT_DB_HOST=db - TJBOT_API_KEY - TJBOT_AUTO_QUESTION_TIME env_file: - .env db: image: mongo:3.0.14 volumes: - mongodbdata:/data/db volumes: mongodbdata: If I change the .env file, how could I reload the container to use the new environment variables with minimum downtime? 回答1: If you are running the yml with docker-compose, you can just run docker