mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Added kubernetes and docker swarm to main TOC. (#497)
This commit is contained in:
34
docs/operating/databases/postgres.md
Normal file
34
docs/operating/databases/postgres.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# IronFunctions using Postgres
|
||||
|
||||
Let's presuppose you don't have even a postgres DB ready.
|
||||
|
||||
### 1. Let's start a postgres instance:
|
||||
|
||||
```
|
||||
docker run --name iron-postgres \
|
||||
-e POSTGRES_PASSWORD=ironfunctions -d postgres
|
||||
```
|
||||
|
||||
### 2. Now let's create a new database to IronFunctions
|
||||
|
||||
Creating database:
|
||||
|
||||
```
|
||||
docker run -it --rm --link iron-postgres:postgres postgres \
|
||||
psql -h postgres -U postgres -c "CREATE DATABASE funcs;"
|
||||
```
|
||||
|
||||
Granting access to postgres user
|
||||
|
||||
```
|
||||
docker run -it --rm --link iron-postgres:postgres postgres \
|
||||
psql -h postgres -U postgres -c 'GRANT ALL PRIVILEGES ON DATABASE funcs TO postgres;'
|
||||
```
|
||||
|
||||
### 3. Now let's start IronFunctions connecting to our new postgres instance
|
||||
|
||||
```
|
||||
docker run --rm --privileged --link "iron-postgres:postgres" \
|
||||
-e "DB_URL=postgres://postgres:ironfunctions@postgres/funcs?sslmode=disable" \
|
||||
-it -p 8080:8080 iron/functions
|
||||
```
|
||||
Reference in New Issue
Block a user