GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mreg/local-docker-psql.MD at master · unioslo/mreg

Expand file tree

/

local-docker-psql.MD

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
32 lines (29 loc) · 728 Bytes
/

local-docker-psql.MD

Copy path

File metadata and controls

32 lines (29 loc) · 728 Bytes
Raw
Copy raw file
Download raw file
Edit and raw actions

First install dockerimage and expose the port to localhost:

docker run -p 127.0.0.1:5432:5432 --name postgres -e POSTGRES_PASSWORD=secret -d postgres

Then add a mreg user and db:

psql -h localhost -U postgres template1 << EOF
CREATE EXTENSION citext;
CREATE DATABASE mreg;
CREATE USER mreg WITH ENCRYPTED PASSWORD 'mregpass';
GRANT ALL PRIVILEGES ON DATABASE mreg to mreg;
EOF

If testing with postgresql, grant the mreg user the right to create databases for testing:

psql -h localhost -U postgres << EOF
ALTER USER mreg CREATEDB;
EOF

Finally add settings to django:

cat >> .env << EOF
MREG_DB_NAME=mreg
MREG_DB_USER=mreg
MREG_DB_PASSWORD=mregpass
MREG_DB_HOST=localhost
MREG_DB_PORT=5432
EOF
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.