General API to handle uploads of large data files via HTTP requests
- Elements within
<>
are values you must fill in
- Host machine with Docker CLI
- Docker Desktop for remote repository of docker image
General endpoints to handle processing uploads of entire files or chunks.
- Entire file uploads are saved to the uploads folder and reflected onto the mounted directory on host machine
- Chunk uploads require addition information to restructure the file from received chunks (i.e., chunk number, total number of chunks)
- Entire files are handled through
Forms
, Chunks are handled throughHeader
values - Chunks are stored until all are received in order to reformulate the file
- Files are reformulated via the
async
method,process_data()
through threads.
- Files are reformulated via the
This version is implemented with use of TLS 1.2 encryption via host machine .pem and .key files for verification
Move to the directory with the Dockerfile
Run docker build -t <image-name> .
Tag the docker image
docker tag <image-id> <repository-name>:<tag>
- repository-name is in the form
<username>/<image-name>
Push docker image to an online repository
docker login
docker push <repository-name>:<tag>
Log into remote server, run the following command to pull from the online repository
docker login
docker pull <repository-name>:<tag>
To have the Flask application's /app/uploads
directory mounted to a given file directory on host machine
docker run -d -v <host-machine-directory>:/app/uploads -p <host-port-number>:<container-port-number> <Docker-image>
Setting name to container during the mounting process
docker run -d --name <container-name> -v <host-machine-directory>:/app/uploads -p <host-port-number>:<container-port-number> <Docker-image>
Checking the uploads folder of the dockerized flask server:
docker exec -it <Docker-container-ID> ls ./uploads
- Inclusion of a method to request files from the host machine via GET request.
- Deletion of specific files via DELETE requests.
- System for generating and checking API keys before allowing service.