Skip to content

slobo/docker-postgres

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Base docker image to run a PostgreSQL database server in azk

Postgres versions (tags)

- [`9.3`](https://github.com/azukiapp/docker-postgres/blob/master/9.3/Dockerfile) - [`9.4`, `9`, `latest`](https://github.com/azukiapp/docker-postgres/blob/master/9.4/Dockerfile)

Image content:

  • debian:wheezy
  • PostgreSQL

Usage with azk

Example of using this image with azk:

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */

// Adds the systems that shape your system
systems({
  postgres: {
    // Dependent systems
    depends: [], // postgres, postgres, mongodb ...
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/postgres"},
    shell: "/bin/bash",
    wait: {"retry": 25, "timeout": 1000},
    mounts: {
      '/var/lib/postgresql/data': persistent("postgresql-#{system.name}"),
      '/var/log/postgresql': path("./log/postgresql"),
    },
    ports: {
      // exports global variables
      data: "5432/tcp",
    },
    envs: {
      // set instances variables
      POSTGRES_USER: "azk",
      POSTGRES_PASS: "azk",
      POSTGRES_DB  : "#{manifest.dir}",
    },
    export_envs: {
      // check this gist to configure your database
      // https://gist.github.com/gullitmiranda/62082f2e47c364ef9617
      DATABASE_URL: "postgres://#{envs.POSTGRES_USER}:#{envs.POSTGRES_PASS}@#{net.host}:#{net.port.data}/${envs.POSTGRES_DB}",
    },
  },
});

Usage with docker

To create the image azukiapp/postgres, execute the following command on the docker-postgres folder:

$ docker build -t azukiapp/postgres ./9.4

To run the image and bind to port 5432:

$ docker run -d -p 5432:5432 azukiapp/postgres

Tests

Obs: Very slow process

$ make test

Logs

# with azk
$ azk logs postgres

# with docker
$ docker logs <CONTAINER_ID>

Environment variables

POSTGRES_USER or POSTGRESQL_USER: Set a specific username for the admin account. (default 'azk')

POSTGRES_PASS or POSTGRESQL_PASS: Set a specific password for the admin account. (default 'azk')

POSTGRES_DB or POSTGRESQL_DB : Set a specific database name

License

Azuki Dockerfiles distributed under the Apache License.

About

PostgreSQL Dockerfile for trusted automated Docker builds.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 57.8%
  • Makefile 28.4%
  • Shell 13.8%