Skip to content

Commit ede23d1

Browse files
committed
Add FaunaDB.
1 parent 28c0216 commit ede23d1

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

fauna/.fauna-shell

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
default=localhost
2+
3+
[localhost]
4+
domain=db
5+
port=8443
6+
scheme=http
7+
secret=secret

fauna/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM node:latest
2+
RUN npm install -g fauna-shell
3+
COPY .fauna-shell /root
4+
ENTRYPOINT ["tail", "-f", "/dev/null"]

fauna/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# FaunaDB w/ Docker Compose
2+
3+
This setup contains two separate services -- one for running the DB platform itself, and one for the shell used to interface with that platform.
4+
5+
# Using the Dockerized Fauna Shell
6+
7+
Running `docker-compose up` will activate both the DB and Fauna shell services, removing any need to deal with dependencies on your own machine.
8+
9+
## Accessing the Shell
10+
11+
Enter the container to use the shell with the following:
12+
13+
```
14+
docker-compose exec --user root shell /bin/bash
15+
```
16+
17+
## Running Only the DB Service
18+
To run _only_ the DB, use `docker-compose up shell`. In order to use the Fauna shell with that DB, you'll need to set it up on your machine:
19+
20+
### Set Up the Fauna Shell
21+
22+
Outside your container, you'll need to separately install the `fauna-shell` for interacting with FaunaDB via command line. Dig into the package more [here](https://github.com/fauna/fauna-shell).
23+
24+
### Install the CLI
25+
26+
`npm install -g fauna-shell`
27+
28+
### Configure the Shell
29+
Create a ~/.fauna-shell configuration file.
30+
31+
```
32+
touch ~/.fauna-shell
33+
```
34+
35+
Place the following in that file. These values will set up the shell to interface with your running FaunaDB container.
36+
37+
```
38+
default=localhost
39+
40+
[localhost]
41+
domain=127.0.0.1
42+
port=8443
43+
scheme=http
44+
secret=secret
45+
```
46+
47+
## Create a DB
48+
49+
Run the following:
50+
51+
```
52+
fauna create-database mydatabase
53+
```
54+
55+
Start up a shell with your newly created database with the following:
56+
57+
```
58+
fauna shell mydatabase
59+
```
60+
61+
## Use a Pretty UI Locally
62+
63+
For a pretty web interface through which to managed your local databases, see [FaunaDB's Developer Dashboard](https://github.com/fauna/dashboard).

fauna/docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3'
2+
3+
services:
4+
db:
5+
image: fauna/faunadb:latest
6+
volumes:
7+
- dbdata:/var/log/faunadb
8+
restart: always
9+
ports:
10+
- 8443:8443
11+
shell:
12+
build:
13+
context: .
14+
restart: always
15+
16+
volumes:
17+
dbdata:

0 commit comments

Comments
 (0)