diff --git a/README.md b/README.md
index 1a1d3a5..a0702a2 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ You can use NoDock for simple projects by using one of the [examples](#Examples)
- [Change Node version](#Node-Version)
- [Change Node project location](#Node-Project-Path)
- [Change MySQL database/user/password](#MySQL-Database-User)
+ - [Change PostgreSQL database/user/password](#PostgreSQL-Database-User)
- [Change NGINX reverse proxy port](#NGINX-Reverse-Proxy-Port)
- [Change the timezone](#Change-the-timezone)
- [Use RabbitMQ plugins](#Use-RabbitMQ-plugins)
@@ -86,6 +87,7 @@ We provide examples of configurations you might use for a specific stack. Each e
* [Simple Web with Apache](https://github.com/Osedea/nodock/tree/master/_examples/apache) - Node + Apache
* [Simple Web with Nginx](https://github.com/Osedea/nodock/tree/master/_examples/nginx) - Node + NGINX
* [MySQL](https://github.com/Osedea/nodock/tree/master/_examples/mysql) - MySQL + Node + NGINX
+* [PostgreSQL](https://github.com/Osedea/nodock/tree/master/_examples/postgresql) - PostgreSQL + Node + NGINX
* [Mongo](https://github.com/Osedea/nodock/tree/master/_examples/mongo) - MongoDB + Node + NGINX
* [RabbitMQ](https://github.com/Osedea/nodock/tree/master/_examples/rabbitmq) - RabbitMQ + Node + NGINX
* [Memcached](https://github.com/Osedea/nodock/tree/master/_examples/memcached) - Memcached + Node + NGINX
@@ -290,6 +292,21 @@ You can specify a `PROJECT_PATH` to change the directory in which `npm` will per
- MYSQL_USER=default_user
- MYSQL_PASSWORD=secret
```
+
+#### Change the PostgreSQL database/user/password
+```yaml
+# docker-compose.override.yml
+[...]
+ postgresql:
+ build:
+ args:
+ - POSTGRES_DB=default_db
+ - POSTGRES_USER=default_user
+ - POSTGRES_PASSWORD=secret
+```
+
+
+
#### Change the NGINX reverse proxy port
Use port `8080` instead of `8000` to bind your Node server
diff --git a/_examples/postgresql/README.md b/_examples/postgresql/README.md
new file mode 100644
index 0000000..68118a5
--- /dev/null
+++ b/_examples/postgresql/README.md
@@ -0,0 +1,21 @@
+## PostgreSQL
+
+### Setup
+
+Copy the index file in this folder to the project root:
+
+```bash
+cd /
+
+cp -r nodock/_examples/postgresql/* .
+```
+
+### Usage
+
+```bash
+cd nodock/
+
+docker-compose up -d nginx node postgresql
+```
+
+Visit `127.0.0.1` to see if Node successfully connected to PostgreSQL!
diff --git a/_examples/postgresql/index.js b/_examples/postgresql/index.js
new file mode 100644
index 0000000..b34a33d
--- /dev/null
+++ b/_examples/postgresql/index.js
@@ -0,0 +1,21 @@
+const app = require('express')();
+const { Client } = require('pg');
+
+app.get('/', function(request, response) {
+ const client = new Client({
+ user: 'default_user',
+ host: 'postgresql',
+ database: 'default_db',
+ password: 'secret',
+ post: 5432,
+ });
+
+ client.connect(function(err, res) {
+ if (err) {
+ return response.send('Error occurred while trying to connect to PostgreSQL.');
+ }
+ return response.send(`Connected to ${res.host}:${res.port}.`);
+ });
+});
+
+app.listen(8000);
diff --git a/_examples/postgresql/package.json b/_examples/postgresql/package.json
new file mode 100644
index 0000000..ea49928
--- /dev/null
+++ b/_examples/postgresql/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "postgresql",
+ "version": "1.0.0",
+ "main": "index.js",
+ "license": "MIT",
+ "dependencies": {
+ "express": "^4.16.2",
+ "pg": "^7.4.1"
+ }
+}
diff --git a/docker-compose.yml b/docker-compose.yml
index 32647f8..48728ae 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -28,6 +28,18 @@ services:
expose:
- "3306"
+ postgresql:
+ build:
+ context: ./postgresql
+ args:
+ - POSTGRES_USER=default_user
+ - POSTGRES_PASSWORD=secret
+ - POSTGRES_DB=default_db
+ volumes:
+ - ./data/postgresql/:/var/lib/postgresql
+ expose:
+ - "5432"
+
mongo:
build: ./mongo
expose:
diff --git a/postgresql/Dockerfile b/postgresql/Dockerfile
new file mode 100644
index 0000000..c974697
--- /dev/null
+++ b/postgresql/Dockerfile
@@ -0,0 +1,11 @@
+FROM postgres:10.2
+
+ARG POSTGRES_USER=default_user
+ARG POSTGRES_PASSWORD=secret
+ARG POSTGRES_DB=default_db
+
+ENV POSTGRES_USER=$POSTGRES_USER
+ENV POSTGRES_PASSWORD=$POSTGRES_PASSWORD
+ENV POSTGRES_DB=$POSTGRES_DB
+
+EXPOSE 5432
\ No newline at end of file