Files
fn-serverless/docs/operating/databases/postgres.md
Travis Reeder 9cc12b4b12 Remove iron...
2017-05-18 18:59:34 +00:00

35 lines
895 B
Markdown

# Oracle Functions using Postgres
Let's presuppose you don't have even a postgres DB ready.
### 1. Let's start a postgres instance:
```
docker run --name funcy-postgres \
-e POSTGRES_PASSWORD=funcypass -d postgres
```
### 2. Now let's create a new database for Functions
Creating database:
```
docker run -it --rm --link funcy-postgres:postgres postgres \
psql -h postgres -U postgres -c "CREATE DATABASE funcs;"
```
Granting access to postgres user
```
docker run -it --rm --link funcy-postgres:postgres postgres \
psql -h postgres -U postgres -c 'GRANT ALL PRIVILEGES ON DATABASE funcs TO postgres;'
```
### 3. Now let's start Functions connecting to our new postgres instance
```
docker run --rm --privileged --link "iron-postgres:postgres" \
-e "DB_URL=postgres://postgres:funcypass@postgres/funcs?sslmode=disable" \
-it -p 8080:8080 treeder/functions
```