Skip to content

madgik/Docker-OptiquePostgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgres with Optique data - Docker

Docker Installation

Install Docker (on linux) or Docker-toolbox (on Windows/Mac)

Linux only: Use docker without sudo

Optique Postgres Installation

  1. Open a terminal (Docker Quickstart Terminal on Windows/Mac or standard terminal on Linux).
  2. Download zip and unzip or “git clone” from OptiquePostgres repository
$ git clone https://github.com/madgik/Docker-OptiquePostgres.git
  1. Linux only:
$ sudo service docker start
  1. Navigate to the Stream Server Directory:
$ cd <path to Docker-OptiquePostgres>
  1. Windows only
$ dos2unix docker-entrypoint.sh
  1. Build Stream Server image (this may take a few minutes the first time):
$ docker build -t postgresserver .

Run Optique Postgres container

  1. Execute:
$ docker run -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -i -t --rm  --name postgresserver postgresserver
  1. The "-e POSTGRES_PASSWORD=mysecretpassword" argument is optional.
  2. To change the port the container listens to you need to change the first part of the "-p :5432" argument.
  3. Leave this console open while you are working and then stop the container.
  4. Find your docker machine IP
  5. On Linux is: localhost
  6. On Windows/Mac open a new Docker Quickstart Terminal and run:
$ docker-machine ip

It will return your docker-machine ip (from now on use this instead of localhost if you are on Windows or Mac).

Functionality and Settings

  • The postgres server inside the container has one database named "ns"
  • The default user will be "postgres" and a password can be set but it is optional

Test the Optique Postgres

Test the Optique Postgres using psql

$ psql -p 5432 -U postgres -h <dockerip>

Exit Optique Postgres container

To gracefully stop your docker container:

  1. Select your Optique Postgres docker console.
  2. Press Ctrl+C.
  3. Close the console.

Add datasets

To load your dataset into the postgres database of the container:

  1. Create a sql script file and save it in the same directory as the Dockerfile of this repository
  2. Modify the Dockerfile of this repository and after the line
RUN mkdir /docker-entrypoint-initdb.d

you must add your script file to the container

ADD <name-of-your-script-file>  /docker-entrypoint-initdb.d/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published