added a lttle bit more concise of an update to the docker part of tje readme

This commit is contained in:
Brendan McDevitt 2019-04-06 02:09:13 -05:00
parent 3ed388bd6d
commit 71a490b7fd

View file

@ -1,20 +1,23 @@
# Pastebinner
Check out the examples folder for some examples. I will add more soon.
## Usage
### Configuration
## Configuration
### Docker
- build the image:
#### Docker
- Build the image:
```shell
docker build -t pastebinner .
```
- run the image:
- Run the image:
```shell
docker run -it --env-file .env --network="host" pastebinner
```
#### Console
Set the following environment variables and source them:
The console will launch you into a running pry session where you will have access to an elasticsearch object and a pastebinner object. From there you can poke around and investigate further how the program works.
I am working on setting it up with docker-compose to connect elasticsearch and redis in docker containers.
Set the following environment variables in a file named .env and source them:
```
pastebin_api_key
@ -22,8 +25,17 @@ pastebin_username
pastebin_password
```
optional environment variables if planning on using elasticsearch and redis
```
elasticsearch_url
redis_url
```
If you want to scrape pastes, you can view a json response of the latest pastes by using the ```-s``` or ```--scrape_public``` options.
Creating pastes is built in, check ```lib/api_client.rb```, I am still working on adding in the functionality to use it on the command line.
Creating pastes is built in, check ```lib/api_client```
#### Commandline
The command line app can be used as follows:
```shell