This document provides instructions for building and running the Axionvera Dashboard using Docker containers.
- Docker installed on your system
- Docker Compose installed on your system
# Build and start all services
docker-compose up --build
# Run in detached mode
docker-compose up -d --build
# Stop services
docker-compose downThis will start:
- Frontend (Next.js app served by Nginx) on port 80
- Mock backend API on port 3001
# Build the Docker image
docker build -t axionvera-dashboard .
# Run the container
docker run -p 80:80 axionvera-dashboardThe Dockerfile uses a multi-stage build approach:
- Builder Stage: Compiles the Next.js application using Node.js
- Dependencies Stage: Installs only production dependencies
- Server Stage: Uses Nginx to serve the static files
This approach ensures the final image is lightweight and secure.
The final Docker image is optimized to be under 50MB by:
- Using Alpine Linux base images
- Multi-stage builds to exclude build dependencies
- Proper .dockerignore configuration
- Cleaning up npm cache
The mock backend provides sample API endpoints for development:
GET /api/health- Health checkGET /api/user- User informationGET /api/balance- Account balancePOST /api/transaction- Create transactionGET /api/transactions- Transaction history
NODE_ENV: Set to 'production' for optimized buildsPORT: Backend service port (default: 3001)
For production deployment:
- Build the image:
docker build -t axionvera-dashboard:latest . - Run with proper environment variables
- Consider using a reverse proxy or load balancer
- Implement proper logging and monitoring
- Port conflicts: Ensure ports 80 and 3001 are available
- Build failures: Check that all dependencies are in package.json
- Permission issues: May need to run Docker with appropriate permissions
# View Docker Compose logs
docker-compose logs
# View specific service logs
docker-compose logs frontend
docker-compose logs backend