docker-compose

Get env variables from .env or dockerFile/docker-compose.yml, to config,php to connect to mysql database

那年仲夏 提交于 2021-01-28 07:24:46
问题 Instead of hardcoding the db_username and password, I want to define a env variable in docker. I am new to Docker, so some stuff I still need to learn more about. Another question i want to ask is, if someone else want to run my container, like clone from github, they will have to set themselves the env variables to connect to db right? Create a .env and stuff like that.. config.php <?php define('DB_SERVER', getenv('DB_SERVER')); define('DB_USERNAME', getenv('DB_USERNAME')); define('DB

Kong: docker-compose [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: host or service not provided, or not known

假装没事ソ 提交于 2021-01-28 07:13:57
问题 I'm trying to learn how to use Kong for my API server, but met the error: kong_1 | nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:388: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: host or service not provided, or not known My docker-compose.yaml as below: version: "3" networks: kong-net: driver: bridge services: # Create a service named db. kong-postgres: # Use the Docker Image postgres. This will pull the newest release. image: "postgres" #

I am running 2 images with Docker Compose and I am having trouble hitting the localhost from my Mac. I am exposing ports 3000. Am I missing something?

不问归期 提交于 2021-01-28 06:23:04
问题 I am building a Node/Mongo app using Docker and I am having trouble hitting my localhost from my host computer running MacOs when I run docker-compose up . Using postman or curl -i localhost:3000 returns nothing. I have also tried inspecting the container and connecting with that ip. What am I doing wrong? Thanks! docker-compose.yml: version: "2" services: web: build: . ports: - "3000:3000" volumes: - .:/app env_file: - todoListDocker.env links: - mongo mongo: image: mongo environment: -

How can I use a command from another container using Docker Compose?

爷,独闯天下 提交于 2021-01-28 06:07:10
问题 I have two Dockerfiles: one for adonis (with node docker's hub image) and another for mongo (with mongo docker's hub image). The mongo_service must depend on adonis service because I only want to run adonis after starting all the mongo instances. Therefore, on the end of the mongo dockerfile I run a script which in the end will run: adonis seed adonis serve The error that I'm having is: adonis: command not found I understand that somehow the mongo_service is not having access to the adonis

docker-compose up postgresql error, chown: changing ownership of ‘/var/lib/postgresql/data’: Operation not permitted

穿精又带淫゛_ 提交于 2021-01-28 05:54:04
问题 I'm working in a project and we use docker. The project was fine until last friday and today I started my computer (mac mini - macOS Sierra version 10.12.5 (16F73)) with an error. I'm trying to run docker-compose -f dev.yml -f docker-compose.yml up , but when I execute this it returns the following message : db_1 | chmod: changing permissions of ‘/var/lib/postgresql/data’: Operation not permitted . I had deleted all the docker containers and images docker rm $(docker ps -a -q) docker rmi $

How to store server_key_rsa in docker-compose.yml?

╄→гoц情女王★ 提交于 2021-01-28 03:12:38
问题 I need to store the server_key_rsa of my sftpServer in a docker-compose.yml but I don't know how to store it It's look like that for now : -----BEGIN RSA PRIVATE KEY----- ***********************My Key bla bla bla....... ********************************************** ********************************************** ********************************************** ********************************************** -----END RSA PRIVATE KEY----- And I would like to store it like that: server_key_rsa =

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

随声附和 提交于 2021-01-28 02:54:20
问题 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 . Reading these Version 3 docs, it clearly states mem_limit was removed and to see "upgrading" to guide usage away from this option. These instruction tell you to use the deploy section with resources

Docker-Compose can't connect to MySQL

我与影子孤独终老i 提交于 2021-01-27 20:59:40
问题 I'm trying to connect Django project with MySQL using docker. I have the problem when upping docker-compose. It says the next error: super(Connection, self). init (*args, **kwargs2) django.db.utils.OperationalError: (2002, "Can't connect to MySQL server on 'db' (115)") I'm using port 3307, should i create first new database schema in my local? Or how can I do it because my default port is 3306 but if i try to use it, it says that is busy. My code here: Dockerfile FROM python:3.7 ENV

React craco tailwind postcss integration

[亡魂溺海] 提交于 2021-01-27 18:43:57
问题 My project use craco to start/build, I wish to integrate tailwind postcss. I have follow this tutorial https://dev.to/ryandunn/how-to-use-tailwind-with-create-react-app-and-postcss-with-no-hassle-2i09 But as a result, I am suffering with this error: My config files looks like below: craco.config.js (this one looks like where problem lies, as I feel like the style may overriding craco style underneath, so it caused above error, but not 100% sure how to resolve this puzzl.) module.exports = {

Trying to install DOCKER GPG key recieving error: Curl: option '-' is unknown

空扰寡人 提交于 2021-01-27 18:04:30
问题 I'm trying to add the docker GPG key, and I'm unable to do so because it doesn't recognize that i'm trying to pipe the GPG key into the APT KEY I'm getting back the following error (see picture): curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 回答1: You seems to have a Keyboard mapping issue where the pipe | turns into a redirect symbol > . It seems more related to Digital Ocean and their Console itself where your droplet is hosted - by the look of the image in the