docker-compose

FastAPI and PostgreSQL in docker-compose file connection error

FastAPI and PostgreSQL in docker-compose file connection error Question: This question has been asked already for example Docker: Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? but I still can’t figure out how to properly connect the application to the database. Files: Dockerfile FROM python:3.10-slim WORKDIR /app COPY …

Total answers: 1

How to avoid removing all Docker containers and images while developing a containeraized Python application

How to avoid removing all Docker containers and images while developing a containeraized Python application Question: I’m developing a Python application for Machine Learning models, you can see my docker-compose file here: https://github.com/Quilograma/IES_Project/blob/main/docker-compose.yml. The problem is while developing the application, every time I change a line in the Python code I’ve to kill all active …

Total answers: 1

How to pass argument to docker-compose

How to pass argument to docker-compose Question: import argparse parser = argparse.ArgumentParser() parser.add_argument( ‘–strat’, type=str, ) args = parser.parse_args() strat = args.strat I would like to right my docker-compose.yml file such as I would just pass my argument from there. I did version: "3.3" services: mm: container_name: mm stdin_open: true build: . context: . dockerfile: …

Total answers: 2

Docker image for Flask applicatno

Docker image for Flask applicatno Question: when a run a simple flask application with a specified port(5888) from the console it is running well and is provided with a URL: * Debugger PIN: 125-876-281 * Running on http://127.0.0.1:5888/ (Press CTRL+C to quit) for the same application when I build a docker image and run using …

Total answers: 1

flask app service can't connect to postgres service within docker-compose

flask app service can't connect to postgres service within docker-compose Question: I am trying to run flask, postgres and nginx services with following docker-compose: version: ‘3.6’ services: postgres: image: postgres:10.5 container_name: postgres hostname: postgres user: postgres ports: – "5432:5432" networks: – db-tier environment: CUSTOM_CONFIG: /etc/postgres/postgresql.conf volumes: – ./postgres/sql/create_tables.sql:/docker-entrypoint-initdb.d/create_tables.sql – ./postgres/postgresql.conf:/etc/postgres/postgresql.conf command: postgres -c config_file=/etc/postgres/postgresql.conf restart: …

Total answers: 2

Can't run Selenium inside Docker

Can't run Selenium inside Docker Question: Please help me to run Selenium inside Docker. Below is my code which is not working. I am adding error message as well. Dockerfile: FROM python:3.8-slim # Install the Selenium Python bindings RUN pip install selenium # Download the ChromeDriver executable and add it to the PATH RUN wget …

Total answers: 1

"Name or Service not known" while attaching to container

"Name or Service not known" while attaching to container Question: I’m dockerizin a flask app and everything works till container creation after that there is an error "Name or Service not known" Dockerfile: FROM python:3.10.8 COPY requirements.txt . RUN pip install -r requirements.txt RUN python -c "import nltk; nltk.download(‘averaged_perceptron_tagger’); nltk.download(‘wordnet’); nltk.download(‘omw-1.4’); nltk.download(‘stopwords’);" COPY . . …

Total answers: 1

PySnmp query not working for reachable target but command line 'snmpget' succeeds

PySnmp query not working for reachable target but command line 'snmpget' succeeds Question: I need an SNMP server that can monitor an SNMP agent. For this purpose, I wrote a basic Python application, and I run an SNMP agent (polinux/snmpd image based), on the same network, the agent has a fixed IP address. When I …

Total answers: 1

Connect python app container, postgres container, and persistent database on external harddrive with docker compose

Connect python app container, postgres container, and persistent database on external harddrive with docker compose Question: Using docker-compose, I am running a postgres container (db). The data itself is persistently stored on my Windows machine. And this works. I am unable to get another container running a python application to access the database. My docker-compose …

Total answers: 2