Skip to content

pankajkr-dev/image_resizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Image Resizer Pro A production-oriented Flask application for authenticated image resizing with Postgres-backed user accounts and S3 storage for all uploaded assets. ## Features - Email/password sign-up and login - - Postgres persistence for users and resize history - S3 storage for both original and processed images - Image resize by fitting to dimensions or scaling by percentage - Signed download URLs for stored images - Responsive dashboard UI built with Bootstrap and custom styling - Dockerfile and Docker Compose for local development and EC2 deployment ## Local setup 1. Copy `.env.example` to `.env` and fill in your values. 2. Create a Postgres database named `image_resizer`. 3. Install dependencies: ```bash pip install -r requirements.txt ``` 4. Run the app: ```bash flask --app run.py run ``` The application will create its tables automatically on first start when `AUTO_CREATE_TABLES=true`. ## Docker Start Postgres and the app together: ```bash docker compose up --build ``` The web app will be available on port `8000`. ## Production notes for EC2 - Use an EC2 instance role for S3 access in production by setting `S3_USE_IAM_ROLE=true` and omitting long-lived AWS keys. - Place the app behind Apache HTTPD and run Gunicorn with multiple workers. - Use a managed Postgres instance or a hardened self-managed Postgres server. - Set a strong `SECRET_KEY` and keep `.env` out of source control. ## EC2 + Apache HTTPD The `deploy/ec2/` folder contains a production deployment layout for Amazon EC2: - `deploy/ec2/image-resizer.service` runs Gunicorn under systemd - `deploy/ec2/image-resizer-httpd.conf` configures Apache as a reverse proxy and serves `/static` - `deploy/ec2/setup-ec2.sh` shows the bootstrap steps for Amazon Linux Expected runtime paths on EC2: - Application directory: `/opt/image_resizer2` - Environment file: `/opt/image_resizer2/.env` - Gunicorn bind: `127.0.0.1:8000` - Apache bind: port `80` Before starting the service on EC2, set production values in `.env`, especially: - `DATABASE_URL` pointing to your production Postgres instance - `S3_BUCKET_NAME` pointing to your S3 bucket - `S3_USE_IAM_ROLE=true` when using the EC2 instance profile ## App structure - `app/routes` contains the Flask blueprints - `app/services/image.py` handles resizing - `app/services/s3.py` wraps S3 access - `app/models.py` stores users and image history # image_resizer # image_resizer # image_resizer

About

image resizer app for my ALB , ASG , SNS, CLOUD WATCH testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors