Category : docker

I struggle to attach a debugger with Pycharm with a docker-compose fastAPI setup docker-compose version: ‘3.8’ services: api: build: . volumes: – .:/app ports: – "8080:80" environment: – DATABASE_URL=postgresql://test_user:[email protected]:5432/test_db depends_on: – db db: image: postgres:13-alpine volumes: – postgres_data:/var/lib/postgres/data/ ports: – "5432:5432" environment: – POSTGRES_USER=test_user – POSTGRES_PASSWORD=test_pwd – POSTGRES_DB=test_db volumes: postgres_data: dockerfile: FROM tiangolo/uvicorn-gunicorn:python3.9 COPY requirements.txt ..

Read more

I have a cloud run instance that I am trying to call. In my insomnia client, I get the following error msg: upstream connect error or disconnect/reset before headers. reset reason: connection termination So naturally, I looked at the logs: 2022-01-15T12:45:14.129703772Zterminated: Application failed to start: not available Default 2022-01-15T12:45:15.827887Z[2022-01-15 12:45:15 +0000] [1] [INFO] Handling signal: ..

Read more

Suppose that I have a docker container that I can run as follows. docker run –rm my_container_name:latest python –arg_str ${STR} –arg_int ${INT} –arg_json ${FILE_NAME}.json arg_str, arg_int, arg_json are python’s args. For each execution of GCP could runs, different values are set to these three args. For each id of runs, I have the following schedules ..

Read more

I have the following docker-compose.yml file: version: ‘3’ services: my_service: build: . container_name: my_container network_mode: "host" volumes: – ./script:/script and the following Dockerfile FROM python:latest COPY . . CMD [ "python", "./script/test.py"] test.py: import os os.makedirs(‘/script/my_new_folder_timestamp_here’, 0o0777) The test.py script creates a directory inside the container, with a name that is only known at run ..

Read more

I am trying to create an ansible playbook to install docker & docker-compose on the host server, stop and start the AWS EC2 instance and then restart docker. Everything goes well until I try to stop the instance, then this happens: TASK [docker_setup : Gather facts] ****************************************************************************************************************************************** [DEPRECATION WARNING]: The ‘ec2_instance_facts’ module has been renamed ..

Read more