-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move codes back from orchestrator repo and added readme
- Loading branch information
1 parent
759d019
commit 60e7944
Showing
10 changed files
with
443 additions
and
97 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
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 |
---|---|---|
|
@@ -23,4 +23,5 @@ tmp/ | |
|
||
# vscode debugger | ||
.vscode/ | ||
.env | ||
|
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,28 @@ | ||
FROM python:3.8-slim | ||
# Use an official Python runtime as a base image | ||
FROM python:3.11 | ||
|
||
WORKDIR /app | ||
# Set the working directory in the container | ||
WORKDIR /usr/src/app | ||
|
||
COPY . /app | ||
# Copy the current directory contents into the container at /usr/src/app | ||
COPY . . | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt | ||
# Install Poetry | ||
RUN pip install poetry | ||
|
||
# Avoid creating virtual environments | ||
RUN poetry config virtualenvs.create false | ||
|
||
# Install project dependencies | ||
RUN poetry install | ||
|
||
# Make port 8080 available to the world outside this container | ||
EXPOSE 8080 | ||
|
||
CMD ["python", "app.py"] | ||
# Define environment variable | ||
ENV FLASK_APP=app.py | ||
ENV FLASK_RUN_HOST=0.0.0.0 | ||
ENV FLASK_RUN_PORT=8080 | ||
|
||
# Run Flask | ||
CMD ["poetry", "run", "flask", "run"] |
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
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,17 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# If an argument was provided, use it as the service name prefix. | ||
# Otherwise default to "harvesting-logic". | ||
app_name=${1:-harvesting-logic} | ||
|
||
# Get the current space and trim leading whitespace | ||
space=$(cf target | grep space | cut -d : -f 2 | xargs) | ||
|
||
# Production and staging should use bigger DB instances | ||
if [ "$space" = "prod" ] || [ "$space" = "staging" ]; then | ||
cf service "${app_name}-db" > /dev/null 2>&1 || cf create-service aws-rds medium-psql-redundant "${app_name}-db" --wait& | ||
else | ||
cf service "${app_name}-db" > /dev/null 2>&1 || cf create-service aws-rds micro-psql "${app_name}-db" --wait& | ||
fi |
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
Oops, something went wrong.