I am in the process of migrating all the database records from my docker Postgres environment. I am new to docker and volumes. I have a backup SQL file of Postgres in my local system. How do I access it in my Pgadmin that is running in docker to populate my database in the Postgres container of docker?
This is my docker-compose file, is it possible to add a volume to map to my local device so that I can access files from my pc storage from pgadmin of the docker container?
version: "3.8"
services:
postgres:
image: postgres:11.5
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=****
- POSTGRES_DB=nanomedicine_db
ports: #outside:inside(container)
- 5432:5432
networks:
- shared-network
volumes:
- C:/profitional/nanomedicine/data:/var/lib/postgresql/data
pgadmin:
container_name: pgadmin4_container
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: ****
ports:
- 5050:80
networks:
- shared-network
depends_on:
- postgres
server:
container_name: nanomedicine_server
restart: unless-stopped
image: nanomedicine-server-image:1.0.0
build:
context: nanomedicine-backend
target: production
dockerfile: Dockerfile
ports: #outside:inside(container)
- 8080:8080
networks:
- shared-network
depends_on:
- postgres
client:
container_name: nanomedicine_client
restart: unless-stopped
image: nanomedicine-client-image:1.0.0
build:
context: nanomedicine-frontend
target: production
dockerfile: Dockerfile
ports: #outside:inside(container)
- 3000:3000
networks:
- shared-network
depends_on:
- server
volumes:
postgres-volume:
external: true
networks:
shared-network:
To know a process of accesing my local files from docker container environment of pgadmin


