This is a GraphQL Api that is used with the Lethe React Native application.
You must have the following environment variables set to run development containers.
- SL_DATABASE_URL='mongodb://mongo:27017/dev'
- use whatever mongo server you like, this will be the local mongo container.
- use the following command to connect to the mongo container
docker exec -it letheapi_mongo_1 mongo
Optional environment variables
- SL_APOLLO_ENGINE_API_KEY='your Apollo Engine API Key here'
- PORT=9999 (default port is 9999)
docker-compose up --detach --build
Feel free to drop the --build, but use it for a fresh start on the images.
This command will update the dev environments dependancies.
docker-compose run --rm dev yarn install && yarn cache clean
- graphql playground will be available at http://develop.localhost/graphql
- traefik dashboard will be available at http://traefik.localhost/
these sites will only route in Chrome
Run tests and watch
docker-compose run test yarn test:watch
If you need to add a dependency you will need to add it to the local host for tooling and to the container.
yarn add <dependancy>
Failing to install the dependancy on the host could cause local tooling to not work.
docker-compose run dev yarn add <dependancy>
Installing the dependancy in the container is most important, failure to do so will cause the app to fail on use of a new dependancy
You will need the following secrets defined in your swarm
- apollo_api_key
- sl_database_url
- now_token
- port
docker build --label letheapi --tag letheapi_prod:0.0.4 --target prod .
docker stack deploy --compose-file docker-compose.prod.yml lethe-prod