diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3e20fb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:12 + +WORKDIR /app +COPY ./ /app/ +COPY ./.data/ /app/.data/ +COPY ./.env /app + +RUN npm install -g gulp sass && \ + rm package-lock.json && \ + npm install && \ + npm run build + +EXPOSE 3000 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f15372d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: "3" + +services: + botkit-cms: + container_name: bkc-container + build: . + ports: + - "3000:3000" + restart: always diff --git a/readme.md b/readme.md index 56ecf79..4873edb 100644 --- a/readme.md +++ b/readme.md @@ -150,3 +150,22 @@ cms.loadScriptsFromFile(__dirname + '/scripts.json').catch(function(err) { ``` Note that you might need to modify the call to `cms.loadScriptsFromFile` depending on where you put the scripts.json file. + +## Build/Deploy using docker + +Create .env file from .env_sample
+Create ./.data/scripts.json from ./sample_scripts.json
+Configure the .env file
+ +```bash +PLATFORM=web +TOKENS=youwillneverguessmysecretbottoken +USERS=admin:123secret +``` + +- Run the app + +```bash +docker-compose up -d +``` +The app serves on port 3000 \ No newline at end of file