Setting up Docker Postgres inside Python container

I currently have a python3 web application running in a docker image. I am trying to restore a local database dump in the docker container (dump.pgsql) and connect to that database within my application.
I am having a couple issues.

From within the Python container I can’t seem to download any version of postgres (9.1-9.6) and once I am able to restore the database, how would I get connect (I am currently connecting via Login URI to the cloud database).

  • Creating new container with volume from an older doesn't work as expected
  • Running copies of the same multi-container app with Docker Compose
  • Share local network Docker
  • How to start postgresql and rsync during docker run?
  • Is swarm required for using multi-host networking feature using overlay in docker
  • websphere liberty on docker container
  • My DockerFile is:

    FROM python:3
    ADD . /code
    WORKDIR /code
    EXPOSE 5000
    RUN pip install -r requirements.txt
    #Run Postgres Locally 
    RUN apt-get install -y postgresql-9.2
    RUN postgres restore code.pgsql
    CMD ["python3", ""]

    And I run the command with

    docker build -t code .
    docker run --name code -ti -p 8000:8000 code

  • Should we initialize Docker daemon every time when we restart the blockchain server?
  • Is it possible to connect ipc namespeces with docker compose
  • How to build multi tenant application using docker
  • How to run 2 wordpress blogs using docker on ec2
  • I can't see inside the container with a vnc
  • Manage Kubernetes cluster from UI
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.