This commit is contained in:
2025-10-31 10:02:46 -07:00
parent 14a09b5eff
commit 79a156c5ec
6 changed files with 41 additions and 5 deletions

View File

@@ -1,4 +1,6 @@
Steps for deploy:
1. Try applying terraform
2. gcloud auth application-default set-quota-project `the project id`
3. retry
2. log in to firestore and add a user, generate a service account, and copy settings into .env
Deploy app:
1. gcloud builds submit --tag gcr.io/rothbard-staging2-12345/rothbard-app

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
# Use Python 3.9 as base image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file first (for better caching)
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
# Expose the port the app runs on
EXPOSE 8080
# Command to run the application with gunicorn
CMD exec gunicorn --bind :8080 --workers 1 --threads 8 --timeout 0 app:app

5
app.py
View File

@@ -266,5 +266,6 @@ def dashboard():
return render_template("dashboard.html", rows=detailed_rows, case_email=case_email)
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port=5004)
# GAE compatibility
if __name__ == "__main__"
app.run(debug=True, host="0.0.0.0", port=8080)

11
cloudbuild.yaml Normal file
View File

@@ -0,0 +1,11 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/rothbard-app', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/rothbard-app']
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
args: ['run', 'deploy', 'rothbard-app', '--image', 'gcr.io/$PROJECT_ID/rothbard-app', '--platform', 'managed', '--region', 'us-central1']
eventTrigger:
resource: //pubsub.googleapis.com/projects/$PROJECT_ID/topics/cloud-builds
eventType: google.pubsub.v1.PubsubMessage

View File

@@ -3,3 +3,4 @@ firebase-admin==6.6.0
python-dotenv==1.0.1
requests==2.32.3
itsdangerous==2.2.0
gunicorn==23.0.0

1
runtime.txt Normal file
View File

@@ -0,0 +1 @@
python-3.9