Runs in docker so that all dependencies are in a container.
Can be run on local with variables defined in .env or deployed to Railway and use configured environment variables.
The sample shows how to upload an excel file to a 'posts' collection.
The excel file has columns:
postId | subject | body | image |
---|---|---|---|
1 | Hello | This is a story | https://en.wikipedia.org/image.jpg |
Which maps to the following schema for posts
collection in MongoDB:
_id | title | content | image |
---|---|---|---|
1 | Hello | This is a story | post/postId /originalfilename .png |
.
├── compose.yaml
├── app
├── static/ - css files
├── templates/ - html templates
├── app.py - flask routing
├── Dockerfile - Docker config
├── env.template - environment variables, to store S3 and MongoDB secrets
├── importToMongo.py - script for importing into MongoDB
├── requirements.txt - library requirements
└── uploadToS3.py - script for importing file submitted to AWS S3
$ docker compose up --build
$ docker compose down
Create .env file from env.template