Commit 74eddca6 authored by Vasili Novikov's avatar Vasili Novikov
Browse files

Merge branch 'prebuilt-docker-compose' into 'dev'

Provide prebuilt Pod running options

See merge request memri/pod!250
parents de929382 f0b6e2d3
Showing with 50 additions and 23 deletions
+50 -23
......@@ -6,25 +6,40 @@ It's written in Rust and provides an HTTP interface for use by the clients.
See documentation on:
* Pod-s [HTTP API](./docs/HTTP_API.md)
* How to run Pod (this document)
* Pod [HTTP API](./docs/HTTP_API.md)
* Writing [Plugins](https://blog.memri.io/getting-started-building-a-plugin/)
* Running [Plugins](./docs/Plugins.md)
* [Security](./docs/Security.md)
* What is a [Shared Server](./docs/SharedServer.md)
* How are data types defined in [Schema](./docs/Schema.md)
* [Schema synchronization](./docs/Synchronization.md) between clients/plugins and the Pod
* How to run Pod (this document)
## Run in docker
To run Pod inside docker:
## Build & Run
There are 3 main ways to run Pod: using pre-built docker images to just run it,
building it in docker, and building it locally/natively.
### Run pre-built docker image of Pod
This is the fastest way to get Pod running on your system,
however it only works for Pod versions that have already been built on our server.
To run branch "dev" on commit "de929382":
```
POD_VERSION="dev-de929382" docker-compose --file examples/using-prebuilt-docker.yml up
```
### Run in docker
This is the least involved way to build locally. To build&run Pod inside docker:
```sh
docker-compose up --build
```
### Local build/run
This is the fastest way to compile Pod from source,
for example, if you're making any changes in Pod and want to test it.
It will also work on any OS and CPU architecture.
## Local build/run
In order to build Pod locally, you need Rust and sqlcipher:
You will need Rust >= 1.45 and sqlcipher:
* On MacOS: `brew install rust sqlcipher`
* On ArchLinux: `pacman -S --needed rust sqlcipher base-devel`
......@@ -33,17 +48,9 @@ In order to build Pod locally, you need Rust and sqlcipher:
apt-get install sqlcipher libsqlcipher-dev build-essential
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
* Submit merge requests for your other OS. :)
The minimum required Rust version for any OS is 1.45.
After this, you can run Pod with:
```sh
cargo run -- --help
cargo run -- --owners=ANY
```
Or the easy-to-use development version:
```
./examples/run_development.sh
```
......@@ -66,10 +73,6 @@ You can read about various components of the server:
* Rust language: [rust-lang.org](https://www.rust-lang.org/)
## HTTP API
Pod's API is documented in detail [here](./docs/HTTP_API.md).
## Database
Pod uses SQLite database as its storage mechanism.
......
# docker-compose file for building Pod locally and running it
# See also examples/using-prebuilt-docker.yml for using Pod without compiling it
version: '3'
services:
pod:
build:
context: .
dockerfile: Dockerfile
restart: always
image: pod:latest
ports:
- "0.0.0.0:3030:3030"
networks:
......
......@@ -7,13 +7,13 @@ if ! test -e Cargo.toml; then
exit 1
fi
cargo build
cargo build --release
if ! test -v RUST_LOG; then
export RUST_LOG=pod=debug,info
fi
exec target/debug/pod \
exec target/release/pod \
--owners=ANY \
--insecure-non-tls=0.0.0.0 \
"$@"
version: "3"
services:
pod:
image: "gitlab.memri.io:5050/memri/pod:${POD_VERSION}"
ports:
- "0.0.0.0:3030:3030"
networks:
- memri-net
volumes:
- ./data/db:/data/db
- ./data/files:/data/files
- ./data/certs:/data/certs
- /var/run/docker.sock:/var/run/docker.sock
entrypoint:
- "/pod"
- "--owners=ANY"
# Note that on a real system, you should not use non-https on 0.0.0.0
- "--insecure-non-tls=0.0.0.0"
- "--plugins-callback-address=http://pod_pod_1:3030"
- "--plugins-docker-network=pod_memri-net"
networks:
memri-net:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment