progress
This commit is contained in:
@@ -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
20
Dockerfile
Normal 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
5
app.py
@@ -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
11
cloudbuild.yaml
Normal 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
|
||||
@@ -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
1
runtime.txt
Normal file
@@ -0,0 +1 @@
|
||||
python-3.9
|
||||
Reference in New Issue
Block a user