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).

  • Google cloud sdks doesn't start preview for Docker image Mac OS
  • Understanding “VOLUME” instruction in DockerFile
  • Cannot receieve response from activemq when using docker
  • How insert an existing EC2 instance as container host in docker-machine?
  • Secure Logging drivers with Docker?
  • Does docker community edition is available for docker version 1.12?
  • 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", "app.py"]
    

    And I run the command with

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

  • How to forward data from a host computer to a Docker container?
  • docker run sed doesn't work
  • How to run *BSD OS on Docker?
  • docker-compose run with isolated sets of services?
  • docker-compose error what is this?
  • How run Docker with sync folder on Windows
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.