Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
feat: add entrypoint for running required steps
Browse files Browse the repository at this point in the history
While there, adjust DEPLOYMENT.md accordingly. Also add an environment
variable in Dockerfile to allow specifying specifics targets for
`precache` subcommand.
  • Loading branch information
lucasvuotto authored and AuHau committed Jun 5, 2020
1 parent 421e571 commit b6b0b1f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 1 addition & 3 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ The easiest way is to mount the config directly into the Docker container.
$ git clone https://github.com/rsksmart/rif-marketplace-cache.git
$ cd ./rif-marketplace-cache
$ docker build -t rif-marketplace-cache .
$ docker run -v <path-to-the-config>:/srv/app/config/local.json5 -id rif-marketplace-cache db-sync
$ docker run -v <path-to-the-config>:/srv/app/config/local.json5 -id rif-marketplace-cache precache rns rates
$ docker run -v <path-to-the-config>:/srv/app/config/local.json5 -id rif-marketplace-cache start # Will start the server
$ docker run -v <path-to-the-config>:/srv/app/config/local.json5 -id rif-marketplace-cache --config local
```

## UNIX environment
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ RUN sed -i 's#"./src/cli"#"./lib/cli"#g' package.json

EXPOSE 3030

ENTRYPOINT [ "./bin/run" ]
CMD [ "start" ]
ENV RIFM_PRECACHE_TARGETS all

ENTRYPOINT [ "./bin/entrypoint" ]

LABEL maintainer="adam@iovlabs.org"
LABEL description="Blockchain caching server for RIF Marketplace"
5 changes: 5 additions & 0 deletions bin/entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

./bin/run db-sync "$@"
./bin/run precache "$@" $RIFM_PRECACHE_TARGETS
./bin/run start "$@"

0 comments on commit b6b0b1f

Please sign in to comment.