-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from KarmaComputing/23-containerization
wip #23 containerization
- Loading branch information
Showing
18 changed files
with
87 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
SECRET_KEY=changeme | ||
DEBUG=True | ||
UPLOAD_FOLDER="/path/to/upload/folder" | ||
PORT=25 | ||
DOMAIN=127.0.0.1:5000 | ||
SERVER_NAME=example.com | ||
SMTP_SERVER=email.example.com | ||
SENDER_EMAIL=[email protected] | ||
PASSWORD=changeme | ||
receiver_email_1=[email protected] | ||
STRIPE_SECRET_KEY=changeme | ||
SECRET_KEY="ASDSADASDASDASDadsf" | ||
DEBUG="True" | ||
APP_UPLOAD_FOLDER="/ecw-to-tiff/uploads" | ||
DOCKER_SOCKET="/var/run/docker.sock" | ||
DOCKER_LIB="/usr/bin/docker" | ||
# change to absolute path where your upload folder inside the app folder is. | ||
UPLOAD_FOLDER_MOUNT_PATH="/path/to/ecw-to-tiff-conversion/app/uploads" | ||
SEND_EMAIL="False" | ||
|
||
# remove the comments below only if SEND_EMAIL="TRUE" | ||
#DOMAIN=127.0.0.1:8888 | ||
#PORT=25 | ||
#SMTP_SERVER=email.example.com | ||
#[email protected] | ||
#PASSWORD="changeme" | ||
#receiver_email_1="[email protected]" | ||
#receiver_email_2="[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ __pycache__ | |
venv/ | ||
.env | ||
src/uploads | ||
app/uploads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
uploads/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Use Ubuntu 20.04 as the base image | ||
FROM ubuntu:20.04 | ||
|
||
# Update the package index and install necessary dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common && \ | ||
add-apt-repository ppa:deadsnakes/ppa && \ | ||
apt-get update && \ | ||
apt-get install -y python3.9 python3.9-dev python3.9-distutils python3-pip | ||
|
||
# Make sure pip is up to date | ||
RUN python3.9 -m pip install --upgrade pip | ||
|
||
USER root | ||
WORKDIR /ecw-to-tiff | ||
COPY ./ /ecw-to-tiff | ||
RUN pip3 install -r requirements.txt | ||
ENTRYPOINT ["/ecw-to-tiff/entrypoint.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -exu -o pipefail | ||
|
||
MAP_TO_CONVERT=$1 | ||
UPLOAD_FOLDER=$2 | ||
|
||
# Taking out the extension name | ||
COG_MAP=`echo $MAP_TO_CONVERT | cut -d '.' -f 1` | ||
|
||
docker run --rm -v $UPLOAD_FOLDER:/data geodata/gdal:latest /bin/bash -c "gdal_translate -of GTiff -co COMPRESS=DEFLATE -co PREDICTOR=2 -co ZLEVEL=9 -co BIGTIFF=YES $MAP_TO_CONVERT $COG_MAP'_converted.tiff'" |
0
emails.py → app/emails.py
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
flask run --host 0.0.0.0 --port 8888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Flask==2.2.2 | ||
python-dotenv==0.21.0 | ||
Werkzeug==2.2.2 | ||
stripe |
0
tasks.py → app/tasks.py
100644 → 100755
File renamed without changes.
0
templates/homepage.html → app/templates/homepage.html
100644 → 100755
File renamed without changes.
0
templates/upload_complete.html → app/templates/upload_complete.html
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -exu -o pipefail | ||
|
||
MAP_TO_CONVERT=$1 | ||
UPLOAD_FOLDER=$2 | ||
|
||
# Taking out the extension name | ||
COG_MAP=$(echo "$MAP_TO_CONVERT" | cut -d '.' -f 1) | ||
|
||
docker run --rm -v "$UPLOAD_FOLDER":/data osgeo/gdal:latest /bin/bash -c "cd data; gdal_translate -of COG -co NUM_THREADS=ALL_CPUS -co LEVEL=9 -co COMPRESS=DEFLATE -co BIGTIFF=YES -co PREDICTOR=2 $MAP_TO_CONVERT $COG_MAP'_converted.tiff'" | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: "3.9" | ||
services: | ||
ecw-to-tiff: | ||
build: ./app | ||
volumes: | ||
- "${UPLOAD_FOLDER_MOUNT_PATH}:/ecw-to-tiff/uploads" | ||
- "${DOCKER_SOCKET}:/var/run/docker.sock" | ||
- "${DOCKER_BINARY}:/usr/local/bin/docker" | ||
ports: | ||
- 8888:8888 | ||
env_file: | ||
- .env |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.