feat: Add Dockerfile, docker-compose, and Gitea Actions workflow for initial Clawdbot application deployment.
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m5s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m5s
This commit is contained in:
27
.gitea/workflows/deploy.yml
Normal file
27
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Login to Gitea Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: gitea.lemarechal.eu
|
||||||
|
username: ${{ gitea.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: gitea.lemarechal.eu/aydent/clawdbot:latest
|
||||||
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
FROM node:22-bookworm
|
||||||
|
|
||||||
|
# Install system dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
socat \
|
||||||
|
git \
|
||||||
|
python3 \
|
||||||
|
make \
|
||||||
|
g++ \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install pnpm
|
||||||
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||||
|
|
||||||
|
# Set up user
|
||||||
|
USER node
|
||||||
|
WORKDIR /home/node/app
|
||||||
|
|
||||||
|
# Copy application code
|
||||||
|
COPY --chown=node:node . .
|
||||||
|
|
||||||
|
# Build process
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
RUN pnpm build
|
||||||
|
RUN pnpm ui:build
|
||||||
|
|
||||||
|
# Fix permissions
|
||||||
|
USER root
|
||||||
|
RUN chown -R node:node /home/node/app
|
||||||
|
USER node
|
||||||
|
|
||||||
|
# Default command (can be overridden by docker-compose)
|
||||||
|
CMD ["node", "dist/index.js"]
|
||||||
30
README.md
Normal file
30
README.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Clawdbot Build Repository
|
||||||
|
|
||||||
|
Ce répository contient la configuration de build et de déploiement pour l'agent Clawdbot.
|
||||||
|
|
||||||
|
## Prérequis VPS
|
||||||
|
|
||||||
|
Avant le premier déploiement, vous devez préparer les répertoires sur le VPS pour la persistance des données.
|
||||||
|
|
||||||
|
Exécutez les commandes suivantes sur le serveur :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Création des dossiers
|
||||||
|
sudo mkdir -p /opt/clawdbot/config
|
||||||
|
sudo mkdir -p /opt/clawdbot/workspace
|
||||||
|
|
||||||
|
# Attribution des permissions (UID:GID 1000:1000 pour l'utilisateur node)
|
||||||
|
sudo chown -R 1000:1000 /opt/clawdbot
|
||||||
|
```
|
||||||
|
|
||||||
|
## Déploiement
|
||||||
|
|
||||||
|
Le déploiement est automatisé via Gitea Actions. Chaque push sur la branche `main` déclenchera la construction de l'image Docker et son push vers le registre `gitea.lemarechal.eu`.
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
Le fichier `docker-compose.yml` utilise l'image `gitea.lemarechal.eu/aydent/clawdbot:latest` et configure Traefik pour l'accès au Dashboard.
|
||||||
|
|
||||||
|
Assurez-vous que les variables d'environnement suivantes sont définies dans votre contexte de déploiement (ou fichier `.env` si déploiement manuel) :
|
||||||
|
- `GOOGLE_API_KEY`
|
||||||
|
- `DISCORD_BOT_TOKEN`
|
||||||
|
- `CLAWDBOT_GATEWAY_TOKEN`
|
||||||
18
config/clawdbot.json
Normal file
18
config/clawdbot.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"agents": {
|
||||||
|
"defaults": {
|
||||||
|
"model": {
|
||||||
|
"primary": "google/gemini-1.5-pro"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"channels": {
|
||||||
|
"discord": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"server": {
|
||||||
|
"host": "0.0.0.0",
|
||||||
|
"port": 18789
|
||||||
|
}
|
||||||
|
}
|
||||||
28
docker-compose.yml
Normal file
28
docker-compose.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
services:
|
||||||
|
clawdbot:
|
||||||
|
container_name: clawdbot
|
||||||
|
image: gitea.lemarechal.eu/aydent/clawdbot:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- GOOGLE_API_KEY
|
||||||
|
- DISCORD_BOT_TOKEN
|
||||||
|
- CLAWDBOT_GATEWAY_TOKEN
|
||||||
|
- XDG_CONFIG_HOME=/home/node/.clawdbot
|
||||||
|
volumes:
|
||||||
|
- /opt/clawdbot/config:/home/node/.clawdbot
|
||||||
|
- /opt/clawdbot/workspace:/home/node/clawd
|
||||||
|
networks:
|
||||||
|
- traefik-net
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
# Router for the Dashboard
|
||||||
|
- "traefik.http.routers.clawdbot.rule=Host(`assistant.lemarechal.eu`)"
|
||||||
|
- "traefik.http.routers.clawdbot.entrypoints=https"
|
||||||
|
- "traefik.http.routers.clawdbot.tls.certresolver=letsencrypt"
|
||||||
|
- "traefik.http.routers.clawdbot.middlewares=auth-sso@docker"
|
||||||
|
# Service definition
|
||||||
|
- "traefik.http.services.clawdbot.loadbalancer.server.port=18789"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik-net:
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user