Tag: python

How do I access a POST requests body from AWS API Gateway in a connected ECS docker image

I wrote a python ML script that I want to expose as a third party service to my web application. I cannot use AWS Lambda because the dependencies exceed the 50MB/250MB limits of Lambda. So now I’ve decided to restructure the architecture to use API Gateway with EC2 Container Service that contains a dockerized image […]

Docker build on apt-get update fails

Docker fails to build from docker file with a symlink error message. Tried changing the images from python 2.7 to ubuntu:latest, but the issue persists. I am running Docker for Mac and stuck at this issue. My dockerfile: FROM python:2.7 RUN apt-get update && apt-get install -y tdsodbc unixodbc-dev && apt-get clean -y ADD odbcinst.ini […]

How to run aiohttp with gunicorn in docker container?

I have a project, written on aiohttp, and now I’d like to run it with non-default http server, but with gunicorn. As for docker containers, my docker-compose file: version: ‘2’ services: db: image: mongo:3.4.2 ports: – “27017:27017” web: build: . command: gunicorn run:app -c gunicorn.conf.py volumes: – .:/code ports: – “8000:8000” links: – db depends_on: […]

Dependency in requirement.txt not installed

I need to deploy a flask app to google app engine. I used docker and there lines are in Dockerfile: ADD requirements.txt /app/requirements.txt RUN pip install -r /app/requirements.txt In requirements.txt file: Flask==0.12 gunicorn==19.6.0 boto==2.46.1 gcs-oauth2-boto-plugin==1.8 ffmpeg-normalize It is supposed to install install all dependencies. But somehow “ffmpeg-normalize” is not installed in google app engine instances. […]

Installing psycopg2 in an alpine docker container

I am trying to get my django application to use PostgreSQL, however, so far no luck. I set the application to use the PostgreSQL database and linked both containers using docker-compose.yml, but I am getting the error that the module psycopg2 is missing. I installed all of the dependencies as follow: apk –update add python3-dev, […]

(psycopg2.OperationalError) could not connect to server: Connection refused Is the server

I am trying to connect two docker containers, one posgresql and the other a python flask application. both are linking correctly, all connection variables in the python app are taken directly from the ones in the postgres container that are exposed via linking and are identical to those found when inspecting the postgresql container. when […]

ImportError: No module named ssl_match_hostname when importing the docker SDK for Python

In order to use the Docker SDK for Python, I’m trying to import docker in a Python script, but it’s resulting in an ImportError with the following traceback: Traceback (most recent call last): File “/home/kurt/dev/clones8/ipercron-compose/furion/iclib/tests/test_utils/docker_utils.py”, line 1, in <module> import docker File “/home/kurt/.local/lib/python2.7/site-packages/docker/__init__.py”, line 6, in <module> from .client import Client, AutoVersionClient, from_env # flake8: […]

Can't run python script with interpreter inside docker [Errno 13] Permission denied

i’m pretty new at docker and i try to isolate my python interpreter with some modules but i stuck in the beginning. I created a simple script like : print “Hello world” save it in /home/my_user/script.py than run docker run -it –rm –name my-first-python-script -v /home/my_user:/home/my_user python:2 python /home/my_user/script.py and than get python: can’t open […]

Airflow Docker Deployment: Task Not Getting Run After start_date + schedule_interval

I am new to Airflow. I think I have read all of the articles in the Airflow documentation about scheduling, but I still cannot seem to get my DAGs running after the start_date+schedule_interval (i.e. no task instances). I am using docker. I am wondering it I am missing a command that is scheduling Dags, even […]

Communication between two flask services in Docker

I have two Flask apps, each in separate container. I would like to call app A from app B. At the moment I can do that only by hard-coding IP of the app A like this: @app.route(‘/’) def hello_world(): r = requests.get(‘’) return r.text Is there a simple way of making calls using containers aliases? […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.