I have 2 examples of docker file and one is working and another is not. The main difference between the 2 is the base image. Simple python base image docker file: Airflow base image docker file: Before building the docker file run poetry lock in the same folder as the pyproject.toml file! pyproject.toml file: In order to build the images
Tag: docker
How to setup psycopg2 in a docker container running on a droplet?
I’m trying to wrap a scraping project in a Docker container to run it on a droplet. The spider scraps a website and then writes the data to a postgres database. The postgres database is already running and managed by Digitalocean. When I run the command locally to test, everything is fine: I can visualize the spider writing on the
Different response content when on docker
I am making a request to get a download link through the following request: From my windows laptop and my ubuntu server I am getting the following content: b'{“vid”:”kpz8lpoLvrA”,”title”:”Interstellar Main Theme – Hans Zimmer”,”fn”:”X2Download.com-Interstellar Main Theme – Hans Zimmer”,”a”:”Aura Music”,”t”:244,”links”:{“ogg”:{“1”:{“f”:”ogg”,”k”:”128″,”q”:”128kbps”,”size”:”4.02 MB”,”key”:”128kbps”,”selected”:null}},”mp3″:{“2”:{“f”:”mp3″,”k”:”128″,”q”:”128kbps”,”size”:”4.02 MB”,”key”:”128kbps”,”selected”:null}},”mp4″:{“3”:{“f”:”mp4″,”k”:”1080p”,”q”:”1080p”,”size”:”16.87 MB”,”key”:”1080″,”selected”:””},”4″:{“f”:”mp4″,”k”:”720p”,”q”:”720p”,”size”:”12.48 MB”,”key”:”720″,”selected”:”selected”},”5″:{“f”:”mp4″,”k”:”480p”,”q”:”480p”,”size”:”4.21 MB”,”key”:”480″,”selected”:””},”6″:{“f”:”mp4″,”k”:”360p”,”q”:”360p”,”size”:”7.39 MB”,”key”:”360″,”selected”:””},”7″:{“f”:”mp4″,”k”:”240p”,”q”:”240p”,”size”:”7.19 MB”,”key”:”240″,”selected”:””},”8″:{“f”:”mp4″,”k”:”144p”,”q”:”144p”,”size”:”817.20 KB”,”key”:”144″,”selected”:””}},”3gp”:{“9”:{“f”:”3gp”,”k”:”144p”,”q”:”144p”,”size”:”817.20 KB”,”key”:”144″,”selected”:null}}},”token”:”1cc3a03822a2582bcb47b70da2012cdf43fc66d899e6f0a5d14064c7dcec1154″,”timeExpires”:”1660554472″,”status”:”ok”,”p”:”convert”,”mess”:””}’ But when I try on a heroku app, AWS lambda or
Run Docker container and passing a single option with multiple arguments to a python script
I am trying launch a Docker container that has as an entrypoint a python script that accepts a BBOX as an argument. I use a Bash script in order to automate the above. Where the BBOX should be of this form: lonmin latmin lonmax latmax Below is the Bash script run.sh Where <docker_image_name:tag> is a docker image. The arguments are
Install newer version of sqlite3 on AWS Lambda for use with Python
I have a Python script running in a Docker container on AWS Lambda. I’m using the recommended AWS image (public.ecr.aws/lambda/python:3.9), which comes with SQLite version 3.7.17 (from 2013!). When I test the container locally on my M1 Mac, I see this: However, I use newer SQLite features, so I need to find a way to use a newer version of
How to create a Dockerfile for streamlit app
I am aiming to deploy a web-app written with Sreamlit, I can run this on my local machine by running streamlit run Home.py in my command line. However, I’m not sure how to create the docker file. Any advice? Answer In order to Dockerise your app you need two files: Dockerfile : describes the image structure, docker-compose.yml : describes how
Can’t connect to my Docker Postgres from python suddenly
I’ve been trying to configure my m1 to work with an older ruby on rails api and I think in the process I’ve broken my ability to connect any of my python apis to their database images in docker running locally. When I run: Instead of the lovely psql blinking cursor allowing me to run any sql statement I’d like
how to read a file from a local directory from python code in a docker container?
I have tried to containerize my python code , this is working, building the docker image, running the container and invoking the python code in my app.py file. next, i want to be able to upload the sample.txt file that my python code reads from the root of the application to process some data, sample.txt in the example below. but
Minimal Flask app unreachable from Docker container
I have a very simple flask service that I’m trying to run inside a docker container. I used python to implement a minimal application that is working fine on my Windows, but isn’t reachable when inside a Docker container. I tried the common fix of setting –host=0.0.0.0 (tried multiple ways), but it did not solve my problem. Project structure: ├──
How to stop uvicorn ASGI web server running when building Dockerfile?
Docker build running endlessly I’m trying to build a docker image, but i’m running into an issue with uvicorn server running while building which causes it to never build. so i’m looking for an alternative way of building/running the docker image. Required the docker image should run the uvicorn server on startup Haven’t found any real solution from browsing SOF/Google