pthom/northwind_psql

Running standalone on Windows?

dahlsailrunner opened this issue · 2 comments

Hi - to run this on in a standalone container that I could access from other applications (like VS Code, or an API I was writing), I needed to modify the docker-compose file to look like this:

services:
  db:
    image: postgres:12
    environment:
      POSTGRES_DB: northwind
      POSTGRES_USER: northwind_user
      POSTGRES_PASSWORD: thewindisblowing
    volumes:
      - northwind-pg-data:/var/lib/postgresql/data
      - ./northwind.sql:/docker-entrypoint-initdb.d/northwind.sql
    ports:
      - "5432:5432"

volumes:
  northwind-pg-data:
    external: true

I also needed to run the following command prior to docker-compose up:

docker volume create --name northwind-pg-data -d local

Then I could access the database on localhost:5432 and everything worked great. (thanks for this repo btw). I'm wondering if a PR for either the readme spelling this out and/or a second compose file that could be ref'd with the -f param if someone wanted to do this.

If you think it's a good idea, I'll submit a PR. If you're not interested, that's fine - and thanks again for the repo! :)
-Erik

pthom commented

Hi,
Thanks for your suggestion.
This is definitely interesting, with your idea to add ´-f’ and to update the readme.
Please do post a PR.
Thanks !

PR sent! :)