docker-compose

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

Can't Install Python Package onto Docker

Can't Install Python Package onto Docker Question: Trying to install a package (flake8) onto a Docker container (or maybe it’s an image). I’ve pip installed the package locally, and when I try to pip install it again, I get: Requirement already satisfied: flake8 in c:python39libsite-packages (5.0.4) But then when I run this code snippet: docker-compose …

Total answers: 2

Docker-compose environment variable is not set

Docker-compose environment variable is not set Question: Project tree /backend .env.dev docker-compose-dev.yml /project I have the following warning: docker-compose -f docker-compose-dev.yml up –build # i am in the /backend directory WARNING: The DB_USER variable is not set. Defaulting to a blank string. WARNING: The DB_PASSWORD variable is not set. Defaulting to a blank string. WARNING: …

Total answers: 1

how to add playwright docker image to docker compose?

how to add playwright docker image to docker compose? Question: I am building Django app where I want to run Django and playwright images in 1 container in Docker Desktop (locally). Below you can see my docker-compose.yml file: version: ‘3.8’ services: web: build: ./docker_playwright_test command: python manage.py runserver 0.0.0.0:8000 volumes: – ./docker_playwright_test/:/usr/src/docker_playwright_test/ ports: – 8000:8000 …

Total answers: 2

How can I connect to a locally hosted site within a docker container?

How can I connect to a locally hosted site within a docker container? Question: I’m trying to connect to a docker container’s locally hosted address. I’m using Django to serve a website within the container, and I want to connect to it on my local machine. How can I access this site from my local …

Total answers: 1

Python, Mqtt : can publish but can't receive message on docker

Python, Mqtt : can publish but can't receive message on docker Question: I’m running two dockers : one for the mqtt server using mosquitto the other using flask_mqtt the flask container is receiving the CONNACK and is sending the subscribe to the broker but never get any SUBACK however it manages to publish hello word …

Total answers: 1

How to get Airflow Docker ExternalPythonOperator working with in a python venv?

How to get Airflow Docker ExternalPythonOperator working with in a python venv? Question: Situation Since 2022 Sept 19 The release of Apache Airflow 2.4.0 Airflow supports ExternalPythonOperator I have asked the main contributors as well and I should be able to add 2 python virtual environments to the base image of Airflow Docker 2.4.1 and …

Total answers: 1

how can I save docker's database data locally on my server?

how can I save docker's database data locally on my server? Question: I’m running an app inside a docker container. That app uses docker Postgres image to save data in a database. I need to keep a local copy of this database’s data to avoid losing data if the container is removed or purged somehow …

Total answers: 1

Cannot connect to MySQL database container on Docker with Python script

Cannot connect to MySQL database container on Docker with Python script Question: When I try to connect to MySql Database my script get stuck. It simply does nothing. I use docker-compose.yml file (shown below) to run MySql database. version: ‘3.1’ services: db: image: mysql # NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password # (this …

Total answers: 1

can't connect to mysql docker-compose

can't connect to mysql docker-compose Question: I can’t connect my docker app to my MySQL server. But I can connect the app to the server from my local machine. I use MySQL version 8.0.20 app.py: import mysql.connector server_config = { ‘user’: ‘my_user’, ‘password’: ‘my_password’, ‘host’: ‘127.0.0.1’, ‘database’: ‘db’, ‘port’: 3306, } conn = mysql.connector.connect(**server_config) cursor …

Total answers: 1