Skip to content

Commit

Permalink
Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
KarineGEO6 committed May 6, 2024
1 parent 17a7e4d commit 52df38a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ RUN pip install -r requirements.txt
RUN pip cache purge; exit 0
RUN apt-get update && apt-get install -y dos2unix
COPY ./src .
COPY .env .

# Check if .env exists, if it does, copy .env file
# Otherwise, set up environment variable from build arguments
RUN if [ -f .env ]; then \
cp .env /app/.env; \
else \
echo "EDS_API_URL=${EDS_API_URL}" >> .env; \
echo "EDS_AUTH_URL=${EDS_AUTH_URL}" >> .env; \
echo "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" >> .env; \
echo "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" >> .env; \
echo "INPUT_JSON_PATH=${INPUT_JSON_PATH}" >> .env; \
echo "GATEWAY_STAGE=${GATEWAY_STAGE}" >> .env; \
fi

COPY docker-entrypoint.sh /usr/local/bin/
RUN dos2unix /usr/local/bin/docker-entrypoint.sh
Expand Down
3 changes: 2 additions & 1 deletion src/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
@app.get("/")
def welcome():
return {
"Welcome to ": "Reflectance Datacube Processor, please add '/docs' to URL to open swagger UI"
"Welcome to ": "Reflectance Datacube Processor, please add '/docs' to URL to open swagger UI",
"Token URL": tokenUrl
}


Expand Down

0 comments on commit 52df38a

Please sign in to comment.