Skip to content

Load curriculum info into PostgreSQL using docker compose

Panagiotis Kapsalis edited this page Feb 10, 2020 · 1 revision

Execute the following docker-compose script and set to db's volumes the path of your .sql dump file e.g

- ./DB_SQL_10_02_2020.sql:/docker-entrypoint-initdb.d/DB_SQL_10_02_2020.sql

version: '3.7'

services:

  curriculum_db:
    image: postgres:11
    hostname: curriculum
    container_name: curriculum
    restart: always
    ports:
      - 5436:5432
    volumes:
      - curriculum_db:/var/lib/postgresql/data
      - ./DB_SQL_10_02_2020.sql:/docker-entrypoint-initdb.d/DB_SQL_10_02_2020.sql
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=curriculum
    networks:
      - qcurriculum


networks:
  qcurriculum:
    driver: bridge

volumes:
  curriculum_db: