docker-compose

kubernetes volume for node_modules

梦想的初衷 提交于 2019-12-12 13:35:17
问题 In docker-compose I was used to create volumes in this way: volumes: - ./server:/home/app - /home/app/node_modules in order to solve the problem of node_modules . How could I approach the problem in kubernetes? I've created the following config spec: containers: - env: [] image: "image" volumeMounts: - mountPath: /home/app name: vol-app - mountPath: /home/app/node_modules name: vol-node-modules name: demo volumes: - name: vol-app hostPath: path: /Users/me/server - name: vol-node-modules

docker, MYSQL_ROOT_PASSWORD do not work

痴心易碎 提交于 2019-12-12 12:27:43
问题 docker-compose: mysql: image: mysql:5.7.16 container_name: f_mysql volumes: - ./db:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: sheep expose: - '3306' and I use docker exec input this container, and I type echo $MYSQL_ROOT_PASSWORD , then I got sheep , but the mysql root password still is '', when I type 'mysql -uroot', I login mysql. 回答1: You need to fix your docker-compose file: environment: - MYSQL_ROOT_PASSWORD=sheep The following is the full docker-compose that achieves what you want

Docker Connecting PHP container to MySQL

拈花ヽ惹草 提交于 2019-12-12 11:09:51
问题 I have two containers, a apache-php container, and a mysql db container. I am trying to get my php script to query my sql database. I am however receiving the following errors; Fatal error: Uncaught PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known AND Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] No such file or directory when toggling the host address, i think i am missing something fundamental to docker and this is

MongoDB on with Docker “failed to connect to server [localhost:27017] on first connect ”

删除回忆录丶 提交于 2019-12-12 10:43:30
问题 I am using mongoDB with and NodeJS backend. The Problem is I am getting the following error node:16) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017] This is my docker-compose version: '3.4' services: db: image: mongo:latest ports: - '27017:27017' rest-api-node: build: . ports: - '5000:5000' links: - db restart: on-failure I have tried with depends_on as well , was not

Error invoking chaincode using Node.js SDK [TypeError: Cannot read property 'getConnectivityState' of undefined]

佐手、 提交于 2019-12-12 10:15:55
问题 Failed to invoke successfully :: TypeError: Cannot read property 'getConnectivityState' of undefined /opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355 if(self._stream) state = self. stream.call.channel .getConnectivityState(); ^ TypeError: Cannot read property 'getConnectivityState' of undefined at ClientDuplexStream.<anonymous> (/opt/share/hyperledger/node_modules/fabric-client/lib/EventHub.js:355:56) at emitOne (events.js:116:13) at ClientDuplexStream.emit (events.js:211

serving flask via nginx and gunicorn in docker

人盡茶涼 提交于 2019-12-12 10:01:31
问题 Playing around with flask I would like to get a real setup up and running in docker. This means flask should be served via nginx and gunicorn. I set up a sample code repository https://github.com/geoHeil/pythonServing but so far can't get nginx to work properly. Flask is served on application:5000 , docker should resolve application to its respective name. Nginx config is as follows: server { listen 8080; server_name application; charset utf-8; location / { proxy_pass http://application:5000;

Is it possible to expose docker ports to a specific interface

限于喜欢 提交于 2019-12-12 09:57:54
问题 My server has two network interfaces, eth0 and wlan0, one connected to the internet and the other to an internal network. The current solution of exposing Docker container ports with docker-compose to a specific interface is to use: version: '2' services: mosquitto: ports: - "192.168.0.1:1883:1883" This makes it brittle since the IP addresses are distributed via DHCP. Several devices are used, of which each may have a different IP address. Therefore, is it possible to expose ports to only a

Passing a docker container's generated name to another container in docker-compose

徘徊边缘 提交于 2019-12-12 09:56:57
问题 Container names, in docker-compose, are generated. And I need to pass this name to another container so it can make a connection. My scenario is, I want to create a container based on docker's container and communicating with the host, execute some thing in a sibling container as the second process within it. So how can I have a container's name within another? 回答1: That will be easy with docker-compose 1.6.1 and the addition of network-scoped alias in docker-compose issue 2829. --alias

Angular-CLI proxy not working inside docker

我怕爱的太早我们不能终老 提交于 2019-12-12 09:54:10
问题 I have a docker-compose file with everything I need for my project. This docker-compose has a nginx server, mysql, phpmyadmin and php. At the top of it, I added recently an angular container. Everything is working fine if I go to localhost:4200, I'm on the angular app, and if I go to localhost:80, I'm on the Laravel backend. Now I need to make a simple classical request to my backend API. I set up a proxy for angular looking like this : { "/api/*": { "target":"http://localhost:80", "secure"

Set extra host in environment variables

柔情痞子 提交于 2019-12-12 09:41:45
问题 I'm using docker compose to run my application. And for do that I need to set the hosts inside container (it's depends on the environment i'm running). My approach was: Create an environment file and set the variable: #application.env SERVER_IP=10.10.9.134 My docker compose file looks like: version: '2' services: api: container_name: myApplication env_file: - application.env build: ./myApplication/ entrypoint: ./docker/api-startup.sh ports: - "8080:8080" depends_on: - redis extra_hosts: