This document describes how to run the VyOS API Manager using Docker, which includes both the FastAPI backend and Next.js frontend.
- Docker installed on your system
- Docker Compose installed on your system (optional but recommended)
Before building the Docker image, make sure you have a proper configuration:
- Create a
.env
file in the root directory with your VyOS router connection details:
VYOS_HOST=your-vyos-router-ip
VYOS_API_KEY=your-api-key
VYOS_HTTPS=true
TRUST_SELF_SIGNED=true # Set to true if your VyOS router uses a self-signed certificate
ENVIRONMENT=production # or development
- Create a
.env
file in the /frontend directory with the following configuration:
NEXT_PUBLIC_API_URL=http://localhost:3001
The simplest way to run the application is using Docker Compose:
# Build and start the container
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the container
docker-compose down
If you prefer to use Docker commands directly:
# Build the Docker image
docker build -t vyosapi .
# Run the Docker container
docker run -p 3000:3000 -p 3001:3001 -v $(pwd)/.env:/app/config/.env:ro --name vyosapi vyosapi
# View logs
docker logs -f vyosapi
# Stop the container
docker stop vyosapi
After starting the container:
- The Next.js frontend is available at: http://localhost:3000
- The FastAPI backend API is available at: http://localhost:3001
For production deployments, consider the following:
- Use a reverse proxy like Nginx to handle SSL termination
- Set proper CORS settings in the FastAPI app
- Use Docker Swarm or Kubernetes for orchestration
- Set up proper logging and monitoring
- Configure backups for any persistent data
If you encounter issues:
- Check the Docker logs:
docker-compose logs
ordocker logs vyosapi
- Verify your
.env
configuration - Ensure your VyOS router is accessible from the Docker container
- For connection issues, test if your VyOS API is working correctly outside Docker