dockerfile

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 configure a PYTHONPATH env variable in the Dockerfile?

How to configure a PYTHONPATH env variable in the Dockerfile? Question: I am modifying the Machine Learning Inference to perform inference using my trained model and to this it is need to import a set of modules. So the project tree is now: . ├── Dockerfile ├── __init__.py ├── app.py ├── requirements.txt ** └── maskrcnn …

Total answers: 3

Python script called in a .NET API in docker, dependencies not found

Python script called in a .NET API in docker, dependencies not found Question: Hello I have a project with the following folder structure (abstracted): . └── root/ ├── ExRate_Service/ │ ├── MyOwnPythonScripts… │ └── Program.py ├── ExRate_API/ │ ├── ExRate_API/ │ │ ├── Classes… │ │ ├── ExRate_API.csproj │ │ └── Program.cs │ ├── ExRate_API.Tests/ …

Total answers: 1

Why does 'pipenv lock -r' errors with 'No such option: -r'?

Why does 'pipenv lock -r' errors with 'No such option: -r'? Question: With this minimal Dockerfile FROM public.ecr.aws/lambda/python:3.8 RUN pipenv lock -r > requirements.txt The pipenv command fails with the error message: Usage: pipenv lock [OPTIONS] Try ‘pipenv lock -h’ for help. Error: No such option: -r And, so, the docker build fails with The …

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

Passing arguments through Docker to argparse not working

Passing arguments through Docker to argparse not working Question: The setup I have a dockercontainer with the following Dockerfile: FROM python:3.10 WORKDIR /usr/src/app ENV ARGS="" COPY requirements.txt ./ COPY main.py ./ COPY … COPY … COPY … RUN apt update RUN apt install ffmpeg -y RUN apt install wkhtmltopdf -y RUN pip install –no-cache-dir -r …

Total answers: 1

How can I build a Dockerfile in finch when sitting behind a proxy and using cntlm as local proxy?

How can I build a Dockerfile in finch when sitting behind a proxy and using cntlm as local proxy? Question: Given the Dockerfile: FROM nexus.company.net/python:3.10-slim-bullseye ARG TWINE_USERNAME ARG TWINE_PASSWORD ARG COMMIT_SHA ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONFAULTHANDLER 1 ENV APP_PATH=/home/appuser/app RUN echo "deb http://ftp.debian.org/debian bullseye-backports main" | tee /etc/apt/sources.list.d/backports.list && …

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