Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
added docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Sep 22, 2022
1 parent 59ce9bb commit 3959423
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 13 deletions.
5 changes: 3 additions & 2 deletions Docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ RUN pip install --upgrade pip
RUN pip install -r requirements.docker.txt
RUN pip install -e .

RUN chmod +x Docker/entrypoint.sh
COPY /entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

#CMD ["uvicorn", "API.main:app", "--reload", "--host", "0.0.0.0", "--port", "8000"]
ENTRYPOINT ["Docker/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]

HEALTHCHECK CMD curl -f http://localhost:8000 || exit 1
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3.8'

services:

app:
build: .
ports:
- 8000:8000
volumes:
- .:/app
depends_on:
- redis

worker:
build: .
command: celery --app API.api_worker worker --loglevel=INFO
volumes:
- .:/app
depends_on:
- app
- redis

redis:
image: redis:6-alpine

worker-dashboard:
build: .
command: celery --app API.api_worker flower --port=5550 --broker=redis://redis:6379/
ports:
- 5550:5550
depends_on:
- app
- redis
- worker
3 changes: 1 addition & 2 deletions Docker/entrypoint.sh → entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash

#!/bin/sh
if [[ -z "${GALAXY_API_CONFIG_FILE}" ]]; then
printf "Error: GALAXY_API_CONFIG_FILE environment variable missing.. Exiting!"
exit 1
Expand Down
9 changes: 6 additions & 3 deletions requirements.docker.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aiofiles==0.7.0
asgiref==3.3.4
click==8.0.1
click==8.0.3
fastapi==0.65.2
h11==0.12.0
importlib-metadata==4.5.0
Expand Down Expand Up @@ -28,5 +28,8 @@ orjson==3.6.7
boto3==1.24.38
Fiona==1.8.21
fastapi-versioning==0.10.0
#gdal and ogr2ogr is required on the machine to run rawdata endpoint
#gdal == 3.3.2
redis==4.3.4
celery==5.2.7
flower==1.2.0
#gdal and ogr2ogr is required on the machine to run rawdata endpoint
# gdal == 3.3.2
16 changes: 10 additions & 6 deletions src/config.txt.sample
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,24 @@ env=dev
#export_path=exports/ # used to store export path
#api_host=http://127.0.0.1
#api_port=8000
#max_area=100000 # max area to support for rawdata input
#use_connection_pooling=True
#max_area=100000 # max area to support for rawdata input
#use_connection_pooling=True
#log_level=info #options are info,debug,warning,error
#env=dev # default is prod , supported values are dev and prod
#shp_limit=6000 # in mb default is 4096

#[EXPORT_UPLOAD]
#FILE_UPLOAD_METHOD=disk # options are s3,disk
#AWS_ACCESS_KEY_ID= your id
#AWS_SECRET_ACCESS_KEY= yourkey
#BUCKET_NAME= your bucket name
#FILE_UPLOAD_METHOD=disk # options are s3,disk
#AWS_ACCESS_KEY_ID= your id
#AWS_SECRET_ACCESS_KEY= yourkey
#BUCKET_NAME= your bucket name

#[TM]
#host=
#user=
#password=
#port=

#[CELERY]
#CELERY_BROKER_URL=redis://localhost:6379
#CELERY_RESULT_BACKEND=redis://localhost:6379

0 comments on commit 3959423

Please sign in to comment.