diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5171c54 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..936f7c7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:lts-alpine + +COPY package*.json ./ + +RUN npm install + +COPY . . + +CMD [ "node", "main.js" ] \ No newline at end of file diff --git a/README.md b/README.md index 6276b4a..9e49676 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A lemmy bot that watches rss feeds and posts new posts from them in communities This bot is made for the https://programming.dev/ communities but the source code can be modified to accomodate any community ## Prerequisites -- You need to have installed node.js in order to run the bot +- You need to have installed node.js or Docker in order to run the bot ## Setup 1. Clone the repository @@ -21,3 +21,15 @@ LEMMY_PASSWORD="" // The bot password I recommend installing something like [forever.js](https://www.npmjs.com/package/forever) which will make it start back up again if it errors at some point If you run into issues feel free to dm me on Matrix [here](https://matrix.to/#/@ategon:matrix.org) + +## Setup with Docker +1. Clone the repository +2. Create an account in the instance you want the bot to have as its home (just make a regular user) +3. Create a file called .env in the bot folder and give it values in this format with the data in the quotes (dont add the slashes or the part after the slashes) +``` +LEMMY_INSTANCE="" // The instance the bot account is in +LEMMY_USERNAME="" // The bot username +LEMMY_PASSWORD="" // The bot password +``` +4. Change the data in config.yaml based on what you want set. Set the communities and feeds you want here +5. In the project directory build the docker image by running `docker build -t /` and then launch a new container with `docker run /` \ No newline at end of file