Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Add specific arm64v8 Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
thought-tobi committed Mar 27, 2024
1 parent 7c70be1 commit 16aea53
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Dockerfile-arm64v8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM arm64v8/python:3.11-slim-bullseye

ENV TELEGRAM_TOKEN=""
ENV MONGODB_HOST="host.docker.internal:27017"
ENV PYTHONPATH=./

# install dependencies
COPY package/requirements.txt .
COPY src ./src/
COPY config.yaml .

RUN python3 -m pip install -r requirements.txt

CMD ["python", "src/app.py"]
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![Build](https://github.com/TobiasWaslowski/telegram-mood-tracker/actions/workflows/build.yml/badge.svg)

# About

This is a Telegram-based Mood Tracker bot. It allows users to record their mood states and other health-related
Expand Down Expand Up @@ -30,6 +32,31 @@ tracking even more easy

## Quickstart

I host the Docker image for this application on a public ECR repository. All you have to do is to create your own
Telegram via the [Botfather](https://t.me/botfather) and supply it to the container as an environment variable:

docker run --env TELEGRAM_TOKEN=$TELEGRAM_TOKEN public.ecr.aws/c1o1h8f4/mood-tracker:latest

I currently provide images for x86_64 and arm64v8 for my own machines and my Raspberry Pi. If you require images
for additional architectures, feel free to raise a ticket or build your own images.

## Specifying Metrics

In the `config.yaml` you can configure your own metrics and notifications. For example, you can track your own mood
as follows:

```yaml
metrics:
- name: anxiety
user_prompt: "What are your anxiety levels like right now?"
values:
HIGHLY_ANXIOUS: 2
SOMEWHAT_ANXIOUS: 1
CALM: 0
```
Metrics have to map to numbers under the hood for purposes of visualization and statistical evaluation (potentially).
These will show up as [Inline Buttons](https://core.telegram.org/bots/2-0-intro#switch-to-inline-buttons) when recording
your mood, with the labels showing up as "Highly Anxious", "Somewhat Anxious" and "Calm".
# Developing
2 changes: 1 addition & 1 deletion scripts/docker-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function build() {
function build_arm() {
mkdir -p package
poetry export -f requirements.txt -o package/requirements.txt --without-hashes
docker build -t mood-tracker:arm64v8 --platform linux/arm/v8 .
docker buildx build -f Dockerfile-arm64v8 -t mood-tracker:arm64v8 --platform linux/arm/v8 .
}

function push_arm() {
Expand Down

0 comments on commit 16aea53

Please sign in to comment.