A simple Docker container to automatically send daily reflections to Notion, using cron
schedule expressions. Container is deployed to Unraid or AWS Lambda + CloudWatch.
- Run the following:
npm run docker:build
npm run docker:tag -- <insert ECR URI>
npm run docker: push -- <insert ECR URI>
-
In AWS Lambda, update to the new image.
-
Test.
-
Setup CloudWatch based on the cron configuration of your choosing.
- In
index.ts
(refer to an older commit), change the cron configuration to one of your choosing. For explanation on how cron works, visit Crontab Guru. In the same file, make changes to the Timezone if necessary. - Save the changes and push to docker hub. A sample of the bash script can be found below:
docker buildx build --platform=linux/amd64 -t notion-dailyreflections .
docker tag notion-dailyreflections your-name/notion-dailyreflections
docker push your-name/notion-dailyreflections
- Proceed to the deployment instructions below
After making changes to the configuration, proceed with the below:
- Go to Docker tab in Unraid
- Create a new container
- Repository should be set to
your-name/notion-dailyreflections
(based on your configuration above)
- This assumes you have pushed your docker image to Docker Hub
- Change from Basic view to Advanced view
- Under
Extra Parameters
, add the below, and proceed to create the container.
--platform=linux/amd64 -e NOTION_TOKEN=XXX -e DATABASE_ID=XXX -e GOSPEL_API=XXX
# Replace XXX with your Notion token, Notion Database ID and Gospel API from https://api.esv.org