Tag: python

Can't reach Flask API running inside a docker container from another container

I appreciate there have been lots of questions about Flask and Docker, and there even more blog posts about how to run a simple Flask API inside a docker container. However, I’m having some troubles reaching a Flask API running inside a container for which I’ve set the host ( and port (5000) from another […]

python2 interpreter in Docker does not support remote project creation with PyCharm

I am using PyCharm 2017.1.1 on Windows 10 Pro with Docker for Windows. The Python2 (Anaconda2) interpreter in docker works well. However, it does not support project creation. How can I solve this problem?

Use spacy docker API

I’m trying to use spacy as an API following as is shown here: After installation the test case works just fine: curl http://localhost:5000/api –header ‘content-type: application/json’ –data ‘{“text”: “This is a text that I want to be analyzed.”}’ -X POST But I want to process the output with python, so I’m trying to use the […]

dockerize a python/jinja2 program to generate a pdf document

I have written a python program that uses Jinja2 along with a Latex file (template.tex) to render the tex file dynamically, i.e. passing jinja variables to template.tex. The file is called jinja_engine.py. Here is what is executed: # import functions # import variables if __name__ == ‘__main__’: template = latex_jinja_env.get_template(‘template.tex’) print (template.render(blocks = blocks, **options)) […]

how to run gunicorn on docker

I have 2 files that depend on each other when docker is start up. 1 is a flask file and one is a file with a few functions. When docker starts, only the functions file will be executed but it imports flask variables from the flask file. Example: Flaskfile import flask from flask import Flask, […]

Docker: Scaling Python container, memory overhead

I have an Alpine Linux container which uses about 120M VIRT, 16K RES and 12K SHR of memory, according to htop. Now I’m wondering, if I want do run multiple instances of that container, will each container grab ~120M of memory? Let’s assume I host this on a 0.6 GB RAM f1-micro on GCP, will […]

How to keep vars between docker exec_run queries ?

I’m using the Docker SDK for Python and i would like to send multiple python queries in the same running container but i don’t arrive to keep vars between queries. I’m using exec_run for each one with python3 -c code maybe it’s not the best way to do it ? The goal is to use […]

getting python and react component based container to work

I am attempting to dockerize this workflow of isomorphic app. I build the container of below docker file. FROM python:3.5-slim RUN apt-get update && \ apt-get -y install gcc mono-mcs && \ apt-get -y install vim && \ apt-get -y install nano && \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /statics/js VOLUME [“/statics/”] WORKDIR /statics/js […]

Issues in using git forked package in Docker-compose

I have installed one package which is forked from original package so I have installed that using pip install -e git://github.com/**package**.git@7f323a3682ddede83a7bf53cdc8d24bcc24d096c#egg=**package** But when I list my packages using docker-compose exec myapp pip list this package is not listed here and I am unable to run my project.

rabbitmq workers keep going offline

I have been using rabbitmq as a broker for my celery workers which is a part of my airflow application. All the 3 of them – rabbitmq, celery and airflow are in docker containers. I have celery workers on 3 nodes that talk to rabbitmq on my master server to broker the job. The application […]

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