diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3ba646b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +**/.git +**/.gitignore +**/.github +**/.vscode +**/coverage +**/.env +**/.aws +**/.ssh +Dockerfile +**/__pycache__ +**/*.pyc +**/*.md +**/*.yml +**/*.yaml +**/*.example +**/.DS_Store +**/venv +**/.venv +**/env \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8287add..02abcb8 100644 --- a/.gitignore +++ b/.gitignore @@ -158,4 +158,8 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +# SyncLink config.yaml +docker-compose.yaml +docker-compose.dev.yaml diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..5ee227f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +stereum@stereum.net. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. diff --git a/Dockerfile b/Dockerfile index 98572ac..e084fa9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM python:3.9 +FROM python:3.10-slim -WORKDIR /code +WORKDIR /opt/synclink-server -COPY ./requirements.txt /code/requirements.txt +COPY ./requirements.txt /opt/synclink-server/requirements.txt -RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt +RUN pip install --no-cache-dir --upgrade -r /opt/synclink-server/requirements.txt -COPY ./ /code +COPY ./ /opt/synclink-server CMD ["python", "main.py"] diff --git a/README.md b/README.md index 2a983a6..a81e0c7 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,59 @@ -# WARNING +# SyncLink Server -**CURRENTLY IN DEVELOPMENT - DO NOT USE IN PRODUCTION!** +![GitHub - SyncLink - ReadMe](https://raw.githubusercontent.com/wiki/stereum-dev/synclink-spec/images/SyncLink-1130x420.png) -You can start the SyncLink Server as described in this document however during development we continue implementing changes that could (and very likely will) make some or all of the described operations and tasks below obsolete. +--- -# SyncLink Server +[![IE](https://img.shields.io/badge/Website-0076D6?style=for-the-badge&logo=Internet%20Explorer&logoColor=white)](https://synclink.io/) [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/8Znj8K6GjN) +[![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white)](https://twitter.com/stereumdev) +[![YouTube](https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white)](https://www.youtube.com/channel/UCq_LYa0idkQcSnxBUmiJm3Q) +[![Gmail](https://img.shields.io/badge/EMail-D14836?style=for-the-badge&logo=gmail&logoColor=white)](mailto:stereum@stereum.net) + +[![Build Status](https://img.shields.io/github/workflow/status/stereum-dev/synclink-server/docker?color=blue)](https://github.com/stereum-dev/synclink-server/actions/workflows/docker.yaml) +[![Latest Release](https://img.shields.io/github/release/stereum-dev/synclink-server?color=blue)](https://github.com/stereum-dev/synclink-server/releases/latest) +![GitHub](https://img.shields.io/github/license/stereum-dev/synclink-server?color=blue) +[![Discord](https://img.shields.io/discord/769190437050122311?color=blue&label=discord)](https://discord.gg/8Znj8K6GjN) +[![GitPOAPs](https://public-api.gitpoap.io/v1/repo/stereum-dev/synclink-server/badge)](https://www.gitpoap.io/gh/stereum-dev/synclink-server) + +Python implementation of the [SyncLink Server](https://github.com/stereum-dev/synclink-spec/wiki/SyncLink-Server). See the [Changelog](https://github.com/stereum-dev/synclink-server/releases) for details of the latest releases and upcoming changes. -A very basic implementation of the [SyncLink Server](https://github.com/stereum-dev/synclink-spec/wiki/SyncLink-Server). +# WARNING + +**CURRENTLY IN DEVELOPMENT - DO NOT USE IN PRODUCTION!** -## Supported clients +You can use the SyncLink Server as described in this document however during development we continue implementing changes that could (and very likely will) make some or all of the described operations and tasks below obsolete. + +# Table of Contents + +* [Supported clients](#supported-clients) +- [Usage](#usage) + * [Configuration](#configuration) + + [Options](#options) + + [Config file](#config-file) + + [Command line arguments](#command-line-arguments) + + [Environment variables](#environment-variables) + * [Getting Started](#getting-started) + + [Run with Docker](#run-with-docker) + - [Images](#images) + - [Quick start with Docker](#quick-start-with-docker) + + [Run from source](#run-from-source) + - [Quick start from source on Windows](#quick-start-from-source-on-windows) + - [Quick start from source on Linux and macOS](#quick-start-from-source-on-linux-and-macos) +* [Contributing](#contributing) +* [Contact](#contact) +- [Docker Examples](#docker-examples) + * [Production Container Examples](#production-container-examples) + + [Start container from image with "run" command and "config file"](#docker-example-prod-run-cfg) + + [Start container from image with "run" command and "command line arguments"](#docker-example-prod-run-args) + + [Start container from image with "run" command and "environment variables"](#docker-example-prod-run-env) + + [Start container from image with "compose" command](#docker-example-prod-compose) + * [Development Container Examples](#development-container-examples) + + [Start container from build-image with "run" command and "config file"](#docker-example-dev-run-cfg) + + [Start container from build-image with "run" command and "command line arguments"](#docker-example-dev-run-args) + + [Start container from build-image with "run" command and "environment variables"](#docker-example-dev-run-env) + + [Start container from build-image with "compose" command](#docker-example-dev-compose) + +# Supported clients | Client | Support | | ---------- | ------- | @@ -18,55 +63,50 @@ A very basic implementation of the [SyncLink Server](https://github.com/stereum- | Lighthouse | ✅ | | Prysm | ✅ | -## Install Python 3 +# Usage -Please refer to the [official Python docs](https://www.python.org/doc/) to install Python >= 3.10 on your OS. +There are multiple ways you can configure and run the SyncLink Server application. While [the recommended setup for production environments is Docker](#run-with-docker), it is also possible to [run the app directly from source with Python](#run-from-source), which is mostly preferred for develpment on your local system, however also an absolutely valid setup for production. -## Install additional Requirements on Windows +## Configuration -Start a virtual environment and install or update required Python packages: +The SyncLink Server [options](#options) must be configured either thru a yaml [config file](#config-file), [command line arguments](#command-line-arguments) or [environment variables](#environment-variables). -``` -python -m venv .venv -".venv/scripts/activate.bat" -pip install -r requirements.txt -``` +### Options + +| Name | Default | Required | Description | +| --------------- | --------------------- | -------- | ----------------------------------------------------------------------------------- | +| addr | 0.0.0.0 | No | The IP address or domain where the SyncLink Server is listening for new connections | +| port | 8000 | No | The port where the SyncLink Serveris listening for new connections | +| eth_api_address | http://localhost:5051 | No | The URL to your Beacon node API (usually running on the same host) | +| config | config.yaml | No | Path to a yaml config file | -## Install additional Requirements on Linux / MacOS +### Config file -On Debian or Ubuntu you first need to install venv: +By default the SyncLink Server attempts to read the configuration from `config.yaml`. The path to this file can however explicitely specified by [command line arguments](#command-line-arguments) or [environment variables](#environment-variables). The configuration management also supports a hierarchical config structure, which means you can optionally add the ["_config_" option](#options) within a config file to load additional settings from a separate config file. +Example `config.yaml` (see [config.yaml.example](./config.yaml.example)): ``` -apt install pythonX.Y-venv +port: 8000 +eth_api_address: http://localhost:5051 ``` -> Replace `X.Y` with the python MAJOR and MINOR version retrieved by `python -V` +### Command line arguments -Then start a virtual environment and install or update required Python packages: +You can also configure the SyncLink Server [options](#options) on the command line. Command line arguments will overwrite all identical [options](#options) that are already defined in the [config file](#config-file) and you can of course set the path to the [config file](#config-file) itself. +By default command line arguments must be prefixed with "--" and always lowercase. +For example, to specify `addr` as command line argument: ``` -python -m venv .venv -source .venv/bin/activate -pip install -r requirements.txt +python main.py --addr="127.0.0.1" ``` -## Configure the App - -1. Copy `config.yaml.example` to `config.yaml` -2. Define settings in `config.yaml` as desired - -| Name | Description | Default | Required | -| --------------- | ------------------------------------------------ | --------------------- | -------- | -| addr | The IP address or domain for the SyncLink server | 0.0.0.0 | No | -| port | The port for the SyncLink server | 8000 | No | -| eth_api_address | The url to your beacon node API | http://localhost:5051 | Yes | - -Optional you can also specify the path to your config file or add/overwrite this arguments on the command line. -Run `python main.py -h` for details. +> In most cases it is also possible to use just a shortcut, run `python main.py -h` for details. ### Environment variables -You can also configure your app by environment variables. These are identical to the command line arguments but must be prefixed with "SYLI_" and always UPPERCASE. +At last you can configure the SyncLink Server [options](#options) by environment variables. They are especially useful with the Docker Image and have the highest priority in the configuration tree. + +Environment variables must be prefixed with "**SYLI_**" and always **UPPERCASE**. For example, to specify `addr` as environment variable: ``` @@ -81,11 +121,11 @@ export SYLI_NODE_1="10.0.0.1" export SYLI_NODE_2="10.0.0.2" python main.py ``` -will be converted to `python main.py --node "10.0.0.1" --node "10.0.0.2"`. +will be converted to `python main.py --node "10.0.0.1" --node "10.0.0.2"`. > However, this is just a demo because the SyncLink Server currently has no arguments that require a list! -If you have accidently specified an environment variable that is not suported on the command line, you need to unset the variable to avoid an error. For example: +If you have accidently specified an environment variable that is not supported (see [options](#options)), you need to unset the variable to avoid an error. For example: ``` export SYLI_BLA="12345" @@ -93,36 +133,69 @@ python main.py ``` will be converted to `python main.py --bla "12345"`. -and of course results in the error `main.py: error: unrecognized arguments: --bla 12345`. +This will of course result in the error `main.py: error: unrecognized arguments: --bla 12345`. Therefore, you'd have to remove the environment variable: ``` unset SYLI_BLA ``` -## Run the App -Activate the virtual environment and run the app. +## Getting started + +The recommended setup for production environments is to [run the SyncLink Server with Docker](#run-with-docker) but it is also possible to [run the SyncLink Server directly from source with Python](#run-from-source). Make sure you've read the [configuration section](#configuration) and then you're good to go. -On Windows: +### Run with Docker +1. If not already done, [install Docker](https://docs.docker.com/get-docker/) on your OS. +2. Pull the SyncLink Server Docker Image ([stereum/synclink-server](https://hub.docker.com/r/stereum/synclink-server/tags)) from Docker Hub and follow the [quick start with Docker](#quick-start-with-docker) or one of the [more advanced Docker examples](#docker-examples) on bottom. + +#### Images +- `latest` - latest release of the SyncLink Server on python:3.10-slim +- `$version` - specific release (e.g.: `v0.0.1`) of the SyncLink Server on python:3.10-slim + +#### Quick start with Docker ``` -".venv/scripts/activate.bat" -python main.py +docker run --name synclink-server --rm -it -p "8000:8000" -e SYLI_ETH_API_ADDRESS="$YOUR_NODE_API_ADDRESS" stereum/synclink-server ``` -On Linux / MacOS: +**Important** + +Change `$YOUR_NODE_API_ADDRESS` to the URL of your Beacon node API (e.g: `http://localhost:5051`). + +After the app is started you can visit the API docs (depending on your [config](#configuration)) by default at . + +If you're done you can stop the Docker container by typing `CTRL+C` in your active terminal. + +### Run from source + +1. Download a release from the [releases page](https://github.com/stereum-dev/synclink-server/releases) (or clone the GitHub repository). +2. Refer to the [official Python docs](https://www.python.org/doc/) to install [Python >= 3.10](https://www.python.org/downloads/) on your OS. +3. On Debian or Ubuntu run `apt install pythonX.Y-venv` to install venv. (Replace `X.Y` with the python MAJOR and MINOR version retrieved by `python -V`) +4. Extract the release (or continue directly with step #5 if you just cloned the GitHub repository). +5. Follow the quick start from source on [Windows](#quick-start-from-source-on-windows) or [Linux and macOS](#quick-start-from-source-on-linux-and-macos) examples. + +#### Quick start from source on Windows +``` +python -m venv .venv +".venv/scripts/activate.bat" +pip install -r requirements.txt +python main.py --addr="$YOUR_NODE_API_ADDRESS" +``` +#### Quick start from source on Linux and macOS ``` +python -m venv .venv source .venv/bin/activate -python main.py +pip install -r requirements.txt +python main.py --addr="$YOUR_NODE_API_ADDRESS" ``` -## Open API Docs +**Important** -After the app is started you can visit the API docs (depending on your settings in `config.yaml`) by default at . +Change `$YOUR_NODE_API_ADDRESS` to the URL of your Beacon node API (e.g: `http://localhost:5051`). -## Stop the App +After the app is started you can visit the API docs (depending on your [config](#configuration)) by default at . If you're done you can stop the Python process and deactivate the virtual environment by typing the following in your active terminal: @@ -130,3 +203,144 @@ If you're done you can stop the Python process and deactivate the virtual enviro CTRL+C deactivate ``` + +# Contributing + +Contributions are greatly appreciated and pull requests will be reviewed/merged ASAP! + +If you're interested in improving the SyncLink Server please follow this steps: + +1. Fork the project +2. Create your feature branch: + - `git checkout -b feat/new-feature` +3. Commit your changes: + - `git commit -m 'feat(optional): new feature` +4. Push the branch: + -`git push origin feat/new-feature` +5. Open a pull request + +> Note: To test your changes in a local Docker container see the [Development Container Examples](#development-container-examples). + +# Contact + +[![Discord](https://img.shields.io/discord/769190437050122311?color=blue&label=discord)](https://discord.gg/8Znj8K6GjN) + +To get in touch just [join the Stereum Discord server](https://discord.gg/8Znj8K6GjN) and leave a message in one of the public channels or drop us an email to [stereum@stereum.net](mailto:stereum@stereum.net). We are happy to get your feedback! + +# Docker Examples + +Below you'll find a few practical examples how to start and stop the SyncLink Server with `docker run` or `docker compose` commands. +Keep in mind that this examples should just give you a hint - it is absolutely your freedom of choice how to run the SyncLink Server! +For more details regarding Docker just visit [https://docs.docker.com](https://docs.docker.com/). + +**Generic description of the used Docker commands** + +| Command | Description | +| ---------- | ------------------------------------------------------------------------------------------------------------------ | +| [docker rm](https://docs.docker.com/engine/reference/commandline/rm) | Remove one or more containers | +| [docker run](https://docs.docker.com/engine/reference/commandline/run) | Run a command in a new container | +| [docker logs](https://docs.docker.com/engine/reference/commandline/logs) | Fetch the logs of a container | +| [docker stop](https://docs.docker.com/engine/reference/commandline/stop) | Stop one or more running containers | +| [docker compose up](https://docs.docker.com/engine/reference/commandline/up) | Create and start containers | +| [docker compose pull](https://docs.docker.com/engine/reference/commandline/pull) | Pull service images | +| [docker compose down](https://docs.docker.com/engine/reference/commandline/compose_down) | Stop and remove containers, networks | + +> See also [https://docs.docker.com/engine/reference/commandline](https://docs.docker.com/engine/reference/commandline) + +**Important** + +Change `$YOUR_NODE_API_ADDRESS` to the URL of your Beacon node API (e.g: `http://localhost:5051`). + +After the app is started you can visit the API docs (depending on your [config](#configuration)) by default at . + +## Production Container Examples + + + +#### Start container from [stereum/synclink-server](https://hub.docker.com/r/stereum/synclink-server/tags) image with `run` command and [config file](#config-file) +Copy [config.yaml.example](./config.yaml.example) to `config.yaml` and [configure](#configuration) as needed, then: +``` +docker rm --force synclink-server +docker run -d --name synclink-server --rm -it -p 8000:8000 -v $(pwd)/config.yaml:/opt/synclink-server/config.yaml stereum/synclink-server +docker logs -f synclink-server +docker stop synclink-server +``` + + + +#### Start container from [stereum/synclink-server](https://hub.docker.com/r/stereum/synclink-server/tags) image with `run` command and [command line arguments](#command-line-arguments) +``` +docker rm --force synclink-server +docker run -d --name synclink-server --rm -it -p 8000:8000 stereum/synclink-server python main.py --eth_api_address="$YOUR_NODE_API_ADDRESS" +docker logs -f synclink-server +docker stop synclink-server +``` + + + +#### Start container from [stereum/synclink-server](https://hub.docker.com/r/stereum/synclink-server/tags) image with `run` command and [environment variables](#environment-variables) +``` +docker rm --force synclink-server +docker run -d --name synclink-server --rm -it -p "8000:8000" -e SYLI_ETH_API_ADDRESS="$YOUR_NODE_API_ADDRESS" stereum/synclink-server +docker logs -f synclink-server +docker stop synclink-server +``` + + + +#### Start container from [stereum/synclink-server](https://hub.docker.com/r/stereum/synclink-server/tags) image with `compose` command +Copy [docker-compose.yaml.example](./docker-compose.yaml.example) to `docker-compose.yaml` and [configure](#configuration) as needed, then: +``` +docker rm --force synclink-server +docker-compose pull +docker-compose --project-name synclink-server up -d +docker logs -f synclink-server +docker-compose --project-name synclink-server down +``` + +## Development Container Examples + + + +#### Start container from `dev/synclink-server` build-image with `run` command and [config file](#config-file) +Copy [config.yaml.example](./config.yaml.example) to `config.yaml` and [configure](#configuration) as needed, then: +``` +docker build --tag dev/synclink-server . +docker rm --force dev-synclink-server +docker run -d --name dev-synclink-server --rm -it -p 8000:8000 -v $(pwd)/config.yaml:/opt/synclink-server/config.yaml dev/synclink-server +docker logs -f dev-synclink-server +docker stop dev-synclink-server +``` + + + +#### Start container from `dev/synclink-server` build-image with `run` command and [command line arguments](#command-line-arguments) +``` +docker build --tag dev/synclink-server . +docker rm --force dev-synclink-server +docker run -d --name dev-synclink-server --rm -it -p 8000:8000 dev/synclink-server python main.py --eth_api_address="$YOUR_NODE_API_ADDRESS" +docker logs -f dev-synclink-server +docker stop dev-synclink-server +``` + + + +#### Start container from `dev/synclink-server` build-image with `run` command and [environment variables](#environment-variables) +``` +docker build --tag dev/synclink-server . +docker rm --force dev-synclink-server +docker run -d --name dev-synclink-server --rm -it -p "8000:8000" -e SYLI_ETH_API_ADDRESS="$YOUR_NODE_API_ADDRESS" dev/synclink-server +docker logs -f dev-synclink-server +docker stop dev-synclink-server +``` + + + +#### Start container from `dev/synclink-server` build-image with `compose` command +Copy [docker-compose.dev.yaml.example](./docker-compose.dev.yaml.example) to `docker-compose.dev.yaml` and [configure](#configuration) as needed, then: +``` +docker rm --force dev-synclink-server +docker-compose --project-name dev-synclink-server -f docker-compose.dev.yaml up -d +docker logs -f dev-synclink-server +docker-compose --project-name dev-synclink-server down +``` \ No newline at end of file diff --git a/config.yaml.example b/config.yaml.example index 812dcf8..faafef5 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -1,2 +1,4 @@ -port: 8000 -eth_api_address: http://localhost:5051 \ No newline at end of file +# config file example +# addr: 0.0.0.0 +# port: 8000 +# eth_api_address: http://localhost:5051 \ No newline at end of file diff --git a/docker-compose.dev.yaml.example b/docker-compose.dev.yaml.example new file mode 100644 index 0000000..510f643 --- /dev/null +++ b/docker-compose.dev.yaml.example @@ -0,0 +1,18 @@ +# development configuration example - builds the image locally: +# docker-compose --project-name dev-synclink-server -f docker-compose.dev.yaml up +# docker-compose --project-name dev-synclink-server -f docker-compose.dev.yaml up -d +services: + synclink-server: + container_name: dev-synclink-server + image: dev/synclink-server + pull_policy: build + build: . + ports: + - "8000:8000" + # volumes: + # - ./config.yaml:/code/config.yaml + environment: + DOCK_ENV: 'dev' + # SYLI_ADDR: 0.0.0.0 + # SYLI_PORT: 8000 + # SYLI_ETH_API_ADDRESS: http://localhost:5051 \ No newline at end of file diff --git a/docker-compose.yaml.example b/docker-compose.yaml.example new file mode 100644 index 0000000..8185e74 --- /dev/null +++ b/docker-compose.yaml.example @@ -0,0 +1,17 @@ +# production configuration example - loads the image from docker hub: +# docker-compose --project-name synclink-server up +# docker-compose --project-name synclink-server up -d +services: + synclink-server: + container_name: synclink-server + image: stereum/synclink-server:latest + restart: always + ports: + - "8000:8000" + # volumes: + # - ./config.yaml:/code/config.yaml + environment: + DOCK_ENV: 'prod' + # SYLI_ADDR: 0.0.0.0 + # SYLI_PORT: 8000 + # SYLI_ETH_API_ADDRESS: http://localhost:5051 \ No newline at end of file