This application grew out of a previous project - the VMware Cloud Sizer Companion CLI. I am using several of the functions in that project to ingest an Excel file, perform some transformations on the data using Pandas, and return some basic statistics.
The entire application has been 'containerized' so I may experiment with pushing to the cloud in a standardized way, and leverage CI/CD.
This project supports multiple environments: local, production, and DHI.
- Docker and Docker Compose
- 1Password CLI (for production/DHI)
- Python 3.11+ (for local development)
-
Copy environment template:
cp envs/.env.template envs/local.env
-
Update
envs/local.envwith your local settings -
For production/DHI, configure 1Password items (see DEPLOYMENT.md)
Create items in 1Password for production and DHI environments:
- Item name:
flask-pandas-production - Fields:
SECRET_KEY,POSTGRES_PASSWORD,DATABASE_URL
Update envs/production.env and envs/dhi.env with references:
SECRET_KEY=op://Private/flask-pandas-production/SECRET_KEY
POSTGRES_PASSWORD=op://Private/flask-pandas-production/POSTGRES_PASSWORD
DATABASE_URL=op://Private/flask-pandas-production/DATABASE_URLFor complete setup instructions, see DEPLOYMENT.md.
# Switch to local
./switch-env.sh local
# Switch to production
./switch-env.sh production
# Switch to DHI
./switch-env.sh dhi# Start services
./deploy.sh local up
# Or use Makefile
make dev
# Stop services
make dev-down# Sign in to 1Password
op signin
# Start services
./deploy.sh production up -d
# Or use Makefile
make prod-up
# View logs
make prod-logs
# Stop services
make prod-down./deploy.sh <env> up # Start services
./deploy.sh <env> down # Stop services
./deploy.sh <env> ps # List services
./deploy.sh <env> logs -f # Follow logs
./deploy.sh <env> exec app bash # Shell into containerFor complete deployment instructions, rollback procedures, and troubleshooting, see DEPLOYMENT.md.
# Run all tests
./scripts/test.sh
# Or use Makefile
make test
# Run specific markers
./scripts/test.sh -m unit
./scripts/test.sh -m integration
# Run with coverage
make test-coverageTests use isolated configuration from envs/test.env. Test database is managed by testcontainers.
For complete testing documentation, fixtures, and troubleshooting, see TESTING.md.