`I am working on a swift program. One part will be a cronjob that runs multiple times a day and reads articles from various news sites and stores them in a database. The second part is to extract facts from these articles and store them and their embeddings.
All the individual functionality is already built. I now need to set this up:
- create the server on my proxmox server
- create all the necessary infrastructure (in particular the postgres and qdrant databases)
- create the a binary that does the above
- create a deployment mechanism when I update the binary
- add some monitoring to know when the cronjob ran (and in particular when it failed)
- for deployment I want to use a tool like ansible or terraform (though terraform's complexity scares me)
- ultimately, I would love the deployment to be integrated into my github workflow as a CD pipeline`
Let's discuss how this can be achieved. Give me some options on tools, designs ...
Great project! Let me break down your requirements and suggest some practical approaches for each component.
Database Infrastructure Options
For PostgreSQL + Qdrant:
- Docker Compose (simplest): Run both databases as containers with persistent volumes
- Ansible playbooks: Install and configure both databases directly on the VM
- Terraform with Docker provider: More complex but infrastructure-as-code
Deployment Architecture Options
Option 1: Simple Docker-based (Recommended for starting)
VM Structure:
├── docker-compose.yml (databases)
├── app/
│ ├── Dockerfile
│ └── your-swift-binary
└── deployment scripts
Pros: Simple, easy to understand, good isolation Cons: Still need to handle Swift binary building
Option 2: Ansible-managed systemd services
- Ansible installs databases natively
- Swift binary runs as systemd service
- Ansible handles deployment and service restart
Option 3: Full containerization
- Everything in containers (including Swift app)
- Docker Compose or Kubernetes (overkill for single server)