Public | Automated Build

Last pushed: a year ago
Short Description
Sample Flask app to upload files to s3
Full Description

AWS Direct Upload Sample

Simple example demonstrating how to accomplish a direct upload to Amazon S3 in a Python Flask application.

Ideally the static assets are processed (minified / compressed) and served from a CDN instead of this app itself.

Running the application

  • Set environment variables for your AWS access key, secret, and bucket name
  • Run:

      docker build -t aws-uploads-sample .
      docker run -d --name "uploader" -p 5000:5000 \
          -e "S3_BUCKET=${S3_BUCKET}" \
          -e "S3_REGION=${S3_REGION}" \
  • Visit localhost:5000/upload to try it out


You can test the AWS credentials provided have the rights to upload as follows:

$ docker exec -it uploader sh

$ python
import boto3
from botocore.client import Config
s3 = boto3.client('s3', 'ap-southeast-1',config=Config(s3={'addressing_style':'path'}))


This sample app is a direct copy of:


The files in this repository are, unless stated otherwise, released under the Apache License. You are free to redistribute this code with or without modification. The full license text is available here.

Docker Pull Command
Source Repository