docker compose depends_on anchor mix
I have the following anchor in docker compose:
Where do the docker image and docker container names come from?
To start a Docker container I ran the command docker compose up -d
. (Actually, the -d
switch is unimportant.)
docker-compose check if an instance already running
Assume we have 3 projects – Project 1, Project 2 and Project 3. Now, each of those Projects needs to have access to a nginx instance that acts as a proxy for the local environment. This instance is it’s own seperate container and started via docker run -d --network=local_network --name nginx -p 80:80 nginx_local
. My other projects are started via docker-compose.
Docker npm install fails and log file does not exists
My dockerfile runs npm install, which fails, it tells me to check a specific log file, but this file does not exists:
Mongodb is not persisting data. I am loosing the database after some hours of insertion
services:
mongodb:
image: mongo:latest
container_name: afilal-mongodb
restart: unless-stopped
ports:
– “27017:27017”
volumes:
– afilal_mongo_data:/data/db
backend:
build: ./backend
ports:
– “5000:5000”
environment:
– NODE_ENV=production
– MONGO_URI=mongodb://mongodb:27017/afilaldb
depends_on:
– mongodb
Is there a way to use docker ecosystem for host applications
I recently tried containerizing a Python script. The issue I have is that the base containers for python weight around 1GB and I don’t think it will be worth it, since it’s just a single script. We do use docker for other applications though.
Why is my service not getting started when added depends on, in docker compose file
angulargenerator service is not getting started even when eurekaserver is UP.
docker compose up -d does not recognize the -d
I have a docker-compose.yml
file and when I try to do
How to set env variable based on /etc/hostname file in docker-compose
I want to set the value of hostname
to some enviroment variable. When it is not defined I would like to read etc/hostname file and get a generated one? When I log into container to check what variables are there (printenv
) a HOSTNAME is already defined. But in docker-compose a value of ${HOSTNAME}
is empty. Should be the HOSTNAME
available there?
Connection timeout connecting to postgres container from within docker compose network
I’ve been having trouble on and off with connecting my app to a postgres container using docker compose. Any attempt at connection from within the shared network times out. For example, trying to run psql -h postgres -U postgres
(or psql postgresql://postgres:unsafe@postgres:5432/postgres
) from another container in the network eventually gives this error after hanging for a couple minutes: