This file contains hidden or 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
| GET apple/default/_search | |
| { | |
| "query": { | |
| "range": { | |
| "price": { | |
| "gte": 100, | |
| "lte": 1000 | |
| } | |
| } | |
| } |
This file contains hidden or 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
| GET apple/default/_search | |
| { | |
| "query": { | |
| "wildcard": { | |
| "item": "air*" | |
| } | |
| } | |
| } |
This file contains hidden or 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
| GET apple/default/_search | |
| { | |
| "query": { | |
| "match": { | |
| "item": "airpods" | |
| } | |
| } | |
| } |
This file contains hidden or 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
| GET recipes/default/_search | |
| { | |
| "query": { | |
| "multi_match": { | |
| "query": "Apple Airpods", | |
| "fields": ["brand", "item"] | |
| } | |
| } | |
| } |
This file contains hidden or 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
| mkdir django-cloudrun && cd django-cloudrun | |
| # move the creds.json file downloaded above to project root | |
| mv ~/Downloads/creds.json . | |
| # source repo for django | |
| mkdir src | |
| touch requirements.txt Dockerfile docker-compose.yml |
This file contains hidden or 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
| Django==3.2.6 | |
| gunicorn==20.1.0 | |
| psycopg2-binary==2.9.1 | |
| django-environ==0.4.5 | |
| google-cloud-secret-manager==2.6.0 | |
| django-storages[google]==1.11.1 |
This file contains hidden or 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
| FROM python:3.8-slim | |
| COPY ./requirements.txt /requirements.txt | |
| COPY ./src /app | |
| WORKDIR /app | |
| RUN python -m venv /py && \ | |
| /py/bin/pip install --upgrade pip && \ | |
| /py/bin/pip install -r /requirements.txt && \ | |
| adduser --disabled-password --no-create-home django-user |
This file contains hidden or 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
| version: '3.9' | |
| services: | |
| app: | |
| container_name: django-app | |
| build: | |
| context: . | |
| ports: | |
| - 8000:8000 | |
| volumes: |
This file contains hidden or 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
| PYTHON_ENV=dev | |
| PORT=8000 | |
| SECRET_KEY=<SECRET> | |
| GS_BUCKET_NAME=django_dev_bucket | |
| USE_CLOUD_SQL_AUTH_PROXY=True | |
| GOOGLE_CLOUD_PROJECT=django-cloudrun-project | |
| DATABASE_URL=postgres://djangodevdbadmin:<Password>@//cloudsql/django-cloudrun-project:us-east1:django-dev-db/djangodevdb |
This file contains hidden or 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
| SECRET_KEY=<SECRET> | |
| GS_BUCKET_NAME=django_dev_bucket | |
| DATABASE_URL=postgres://djangodevdbadmin:<Password>@//cloudsql/django-cloudrun-project:us-east1:django-dev-db/djangodevdb |