Relative Content

Tag Archive for dockerdocker-compose

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.

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.

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: