moonstream/moonstreamapi
Andrey Dolgolev 38947e1379
Merge pull request #919 from moonstream-to/migrate-moonworm-tasks
Migrate moonworm tasks
2024-02-01 12:33:47 +02:00
..
configs Add spire external url. 2023-10-26 20:12:13 +03:00
deploy Fixed deploy service file for api 2023-07-13 17:04:28 +00:00
moonstreamapi Merge pull request #919 from moonstream-to/migrate-moonworm-tasks 2024-02-01 12:33:47 +02:00
scripts Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
.dockerignore Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
.gitignore Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
.isort.cfg Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
Dockerfile Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
README.md Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
dev.sh Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
mypy.ini Fixes to work with spire entity 2023-07-31 14:19:22 +00:00
requirements.txt Bumped bugout package version 2024-01-29 09:43:03 +00:00
setup.py Bumped bugout package version 2024-01-29 09:43:03 +00:00

README.md

moonstream backend

Installation and setup

To set up Moonstream API for development, do the following:

Run server with Docker

To be able to run Moonstream API with your existing local or development services as database, you need to build your own setup. Be aware! The files with environment variables docker.dev.env lives inside your docker container!

  • Copy configs/sample.env to configs/docker.dev.env, or use your local configs from configs/dev.env to configs/docker.dev.env
  • Edit in docker.dev.env file MOONSTREAM_DB_URI and other variables if required
  • Clean environment file from export prefix and quotation marks to be able to use it with Docker
sed --in-place 's|^export * ||' configs/docker.dev.env
sed --in-place 's|"||g' configs/docker.dev.env

Build container on your machine

docker build -t moonstreamapi-dev .

Run moonstreamapi-dev container, with following command we specified --network="host" setting which allows to Docker container use localhost interface of your machine (https://docs.docker.com/network/host/)

docker run --name moonstreamapi-dev \
  --network="host" \
  --env-file="configs/docker.dev.env" \
  -p 7481:7481/tcp \
  -ti -d moonstreamapi-dev

Attach to container to see logs

docker container attach moonstreamapi-dev