From 4ec63f9bb58cab174122c21c60d34e755b216e97 Mon Sep 17 00:00:00 2001 From: Logan Nehrbass <39987450+LoganNehrbass@users.noreply.github.com> Date: Sun, 5 Sep 2021 16:48:11 -0700 Subject: [PATCH] Add Docker image file. This will allow this bot to be run in the node js docker container. To build just pull down the forked repository, move into the projects directory change the configuration file to the desired settings and to build the image run "docker build -t name/twitter-image-bot . --no-cache". Then to run the docker run command would be docker run -d \ --name=dogbot \ -e PUID=1000 \ -e PGID=1000 \ -v /opt/twitter-image-bot/images1:/images1 \ -v /opt/twitter-image-bot/images2:/images1 \ --restart unless-stopped \ name/twitter-image-bot:latest You can change images, add or remove if you keep the -v flags by navigating to /opt/twitter-image-bot/ to see those two image folders. --- dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 dockerfile diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..e3ed2f3 --- /dev/null +++ b/dockerfile @@ -0,0 +1,6 @@ +FROM node:lts-alpine +RUN apk add dumb-init +ENV NODE_ENV production +COPY . . +RUN npm ci --only=production +CMD ["dumb-init", "node", "server.js"]