docker-compose

django with docker , TCP/IP connections on port 5432 error

django with docker , TCP/IP connections on port 5432 error Question: I have a django application. And the application works fine. But now I try to dockkerize the django application. So my docker file looks like: # pull official base image FROM python:3.9-alpine3.13 # set work directory WORKDIR /usr/src/app # set environment variables ENV PYTHONDONTWRITEBYTECODE …

Total answers: 1

How to rerun docker-compose after modifying containerized python script

How to rerun docker-compose after modifying containerized python script Question: Docker newbie question here. I am working on containerizing my own Python script, following this tutorial and that tutorial. I noticed that when I fix an error in my Python script (myscript.py), this change is not seen upon rerunning sudo docker-compose up. I need to …

Total answers: 1

Install python package on a specific folder instead of user level

Install python package on a specific folder instead of user level Question: So I am currently working on a DevOps task for a Python repository. I am tasked with making the repository work properly with our Docker environment. My current issue is that when running pip3 install, it installs everything in various folders that have …

Total answers: 2

Python Yaml: Iterating through text values

Python Yaml: Iterating through text values Question: I have this docker-compose.yaml file. I want to iterate through parameters that can be customized by a user. Meaning that I’m only interested in Values, specifically text values. Examples of such values would be: debug,disable-ssl-client-postgres found under the services: callback: environment: SPRING_PROFILES_ACTIVE: key ./ found under the services: …

Total answers: 2

Where to securely store Google_Application_Credentials in Django project?

Where to securely store Google_Application_Credentials in Django project? Question: I have a Django project that uses the Google API. I created a docker-compose.yml which has my Django container and Nginx container. It builds successfully but when I run docker-compose up, I get following error: google.auth.exceptions.DefaultCredentialsError: File /file/path/credentials.json was not found. I have installed the Google …

Total answers: 1

Docker Compose with Django and Postgres Fails with "django.db.utils.OperationalError: could not connect to server:"

Docker Compose with Django and Postgres Fails with "django.db.utils.OperationalError: could not connect to server:" Question: I am trying to run my django/postgres application with docker compose. When I run docker compose up -d I get the the following logs on my postgres container running on port 5432: 2023-02-18 00:10:25.049 UTC [1] LOG: starting PostgreSQL 13.8 …

Total answers: 1

docker compose Flask app returning empty response

docker compose Flask app returning empty response Question: I am trying to play with a dockerized flask container using docker-compose. The flask app is a hello world app that works correctly when I test it on my host. The docker-compose file looks like this: version: ‘3’ services: web: image: ubuntu build: context: ./ dockerfile: Dockerfile …

Total answers: 1

Why am I getting "Volumes must be mapping" error

Why am I getting "Volumes must be mapping" error Question: Trying to add Django app with a PostgreSQL db to a Docker container. When trying to run "docker-compose build", I am getting a "Volumes must be mapping" error. Not sure what I’m doing wrong as it looks like the : syntax signified a mapping. When …

Total answers: 1

Why can't docker compose find uvicorn module

Why can't docker compose find uvicorn module Question: I am new to docker and was trying to dockerize my fastapi application. I built a Dockerfile shown below # syntax=docker/dockerfile:1 FROM python:3.8-slim-buster WORKDIR /app COPY requirements.txt requirements.txt RUN apt-get update RUN apt-get -y install libpq-dev gcc RUN apt-get -y install libnss3-tools RUN apt-get -y install curl …

Total answers: 2

Access to fetch at 'http://localhost:8000/api/v1' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy

Access to fetch at 'http://localhost:8000/api/v1' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy Question: This issue is well documented but my attempts have been unsuccessful… any suggestions are welcome! cookiecutter project on Github: Buuntu/fastapi-react Recreating Error cookiecutter gh:Buuntu/fastapi-react –no-input cd fastapi-react-project modified files before running build script (in order to address prior errors): frontend/Dockerfile …

Total answers: 1