This document explains how to deploy the Voice-TimeLogger-Agent application both locally and on an EC2 instance.
- Docker and Docker Compose installed
- An OpenAI API key
- A Google service account JSON key file with Google Sheets access
- For EC2 deployment: An EC2 instance with SSH access
There are two ways to deploy and test the Voice-TimeLogger-Agent:
- Direct API approach: Deploy only the API service and interact with it directly
- n8n workflow approach: Deploy both the API and n8n services, and use the n8n workflow as an intermediary
- Copy
.env.exampleto.envand edit with your actual API keys and settings - Place your Google service account JSON file in the
credentials/directory asgoogle-service-account.json
chmod +x setup.sh
./setup.shdocker-compose up -dThe API will be available at http://localhost:8000 The n8n workflow automation tool will be available at http://localhost:5678
# Test the API directly
curl -X POST "http://localhost:8000/api/v1/speech/upload" \
-H "Content-Type: multipart/form-data" \
-F "file=@examples/audio/example_meeting_1.mp3" \
-F "notify=true"# Test via the n8n webhook (after configuring the workflow)
curl -X POST "http://localhost:5678/webhook/YOUR_WEBHOOK_PATH" \
-F "file=@examples/audio/example_meeting_1.mp3" \
-F "notify=true"Each approach has its advantages:
- The direct API approach is simpler for development and debugging
- The n8n workflow approach provides visual workflow management and additional automation options
Note:
The setup script (setup.sh) only needs to be run once to create the necessary directories and check for required files. For subsequent deployments, you can run:docker-compose up -ddirectly.
docker-compose logs -fAfter deploying the application, you'll need to configure n8n:
- Access n8n at http://localhost:5678
- Create an n8n account or log in
- Import the workflow from n8n_workflow/voice-timelogger-workflow.json
- Configure the required credentials:
- Google Sheets (for storing meeting data)
- SMTP (for email notifications)
- Activate the workflow
Refer to n8n Workflow Documentation for detailed setup instructions.
- An EC2 instance running Amazon Linux 2 or Ubuntu
- Docker and Docker Compose installed on the instance
- An SSH key pair for connecting to the EC2 instance
- Copy
.env.exampleto.envand edit with your actual API keys and settings - Place your Google service account JSON file in the
credentials/directory asgoogle-service-account.json - Place your EC2 SSH private key in the
credentials/directory (e.g.,voice-timelogger-key.pem) - Make the deployment script executable:
chmod +x deploy-to-ec2.sh./deploy-to-ec2.sh ./credentials/your-key.pem ec2-user@your-ec2-ipReplace:
your-key.pemwith your actual SSH key filenameyour-ec2-ipwith your EC2 instance's public IP address- If using a different user than
ec2-user(e.g., for Ubuntu, useubuntu), update accordingly
Once deployment completes, the API will be available at http://your-ec2-ip:8000 The n8n workflow automation tool will be available at http://your-ec2-ip:5678
You can SSH into your EC2 instance to check logs:
ssh -i ./credentials/your-key.pem ec2-user@your-ec2-ip
cd voice-timelogger
docker-compose logs -f- The setup script creates necessary directories and checks for required files
- Docker Compose builds the application image using the multi-stage Dockerfile
- The container runs with the local directories mounted as volumes
- n8n provides a visual workflow editor and execution engine
-
The
deploy-to-ec2.shscript:- Creates a deployment package excluding sensitive files
- Transfers this package to the EC2 instance
- Transfers sensitive files (.env and credentials) separately
- Extracts the files and starts the application on EC2
-
Docker Compose on EC2:
- Builds the application image
- Starts the container with the correct configuration
- Exposes the API on port 8000 and n8n on port 5678
-
Container fails to start
- Check logs:
docker-compose logs - Verify API keys in
.envfile - Ensure Google service account JSON is correctly placed
- Check logs:
-
Permission issues
- Run
chmod -R 777 ./tmpto ensure the tmp directory is writable
- Run
-
Network issues
- If deploying to EC2, check security group settings to ensure ports 8000 and 5678 are open
-
Deployment script fails
- Verify SSH key has the correct permissions:
chmod 400 ./credentials/your-key.pem - Check EC2 instance status and connectivity
- Verify SSH key has the correct permissions:
-
n8n workflow issues
- See the n8n Workflow Documentation for troubleshooting