data-worker is a application for working with data from TMDb and putting it to database.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Download Node.js not lower than version 8.10, Yarn, Docker and MongoDB Docker image.
Clone this repo to your local machine using https://github.com/menkuichan/data-worker.git
Run your docker image with MongoDB.
docker run --name some-mongo -d mongo:tag
... where some-mongo is the name you want to assign to your container and tag is the tag specifying the MongoDB version you want.
... or run the make utility in the project directory.
make run-mongo
Create and add application configuration to .env file in the root of the project:
APP_PORT=3000
TMDB_API_KEY=YOURSECRETAPIKEY
DB_URI=mongodb://localhost:27017/super-enigma-db
TMDB_BASE_URL=https://api.themoviedb.org/3/
You should to register for an API key, click the API link from within your account settings page.
Use the package manager Yarn to install all the dependencies of data-worker.
yarn install
In the project directory, you can run:
yarn start
Runs the app.
The app will reload if you make changes to the code.
First, make sure that MongoDB is running. Then you need to build a docker image.
make build-image
In the end, run the docker container with server.
docker run -P -d --rm --env TMDB_API_KEY=YOURSECRETAPIKEY --name service-name --link db-name:db image-uri:image-version
... where service-name is the server name, db-name is the database name and so on.
... or run the following command:
make run-service
To stop the service use:
docker stop service-name
... or:
make stop-service
And to stop Docker container with MongoDB use:
docker stop some-mongo
... or:
make stop-mongo