generated from ONSdigital/ons-python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CIMS-4 - Install fastapi and spin up local Hello World application (#4)
* installed fastapi and uvicorn * added hello world method * fixed formatting * installed https dev dependency * set hello world response * initial test and run pytest using poetry * initial test framework * ignored assert lint error * return type in main * ignore assert rule * rearranged directory structure * updated lock file * added make run * set the port value * initial docker framework * initial docker-compose * test commit Signed-off-by: sudeep <[email protected]> * fixed megalint, set poetry version in docker and no cache Signed-off-by: sudeep <[email protected]> * cleanup * makefile entries to start and stop docker * make commands to start and stop docker * makefile changes * makefile changes * simplified docker commands * empty CODEOWNERS * updated ruff * updated packages * test commit * test commit * comments in the makefile * Add instructions for building the Docker image to README * Update README with Docker container management instructions and disable Markdown link check in linter * Disable Markdown link check in linter configuration and update README to prevent link check for the local application URL * test cloud build * test cloud build - 1 * test cloud build and deploy * test cloud build and deploy - 1 * test cloud build and deploy - 2 * pass lint * test cloud build with env var * test cloud build with env var - 1 * test cloud build with env var - 2 * test cloud build with env var - 3 * test cloud build in dev project * set the port value * check unauthenticated * test cloud build * test cloud build - 1 --------- Signed-off-by: sudeep <[email protected]>
- Loading branch information
1 parent
0ec59d3
commit 904980b
Showing
14 changed files
with
539 additions
and
214 deletions.
There are no files selected for viewing
File renamed without changes.
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,11 @@ | ||
FROM python:3.12.6 | ||
|
||
WORKDIR /app | ||
|
||
COPY pyproject.toml poetry.lock /app/ | ||
|
||
RUN pip install --no-cache-dir poetry==1.8.4 && poetry install --no-root --no-dev | ||
|
||
COPY . /app | ||
|
||
CMD ["poetry", "run", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "5010"] |
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,31 @@ | ||
steps: | ||
# Build the container image | ||
- name: "gcr.io/cloud-builders/docker" | ||
args: ["build", "-f", "Dockerfile", "-t", "europe-west2-docker.pkg.dev/${PROJECT_ID}/docker-images/cir-converter-service:$SHORT_SHA", "."] | ||
|
||
# Push the container image to Google Artifact Registry | ||
- name: "gcr.io/cloud-builders/docker" | ||
args: ["push", "europe-west2-docker.pkg.dev/${PROJECT_ID}/docker-images/cir-converter-service:$SHORT_SHA"] | ||
|
||
# Deploy the container to Google Cloud Run | ||
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk" | ||
id: "Run container" | ||
entrypoint: gcloud | ||
args: | ||
[ | ||
"run", | ||
"deploy", | ||
"cir-converter-service", | ||
"--image", | ||
"europe-west2-docker.pkg.dev/${PROJECT_ID}/docker-images/cir-converter-service:$SHORT_SHA", | ||
"--port", | ||
"5010", | ||
"--region", | ||
"europe-west2", | ||
"--platform", | ||
"managed", | ||
"--allow-unauthenticated", | ||
] | ||
|
||
options: | ||
logging: CLOUD_LOGGING_ONLY |
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,7 @@ | ||
services: | ||
web: | ||
build: . | ||
ports: | ||
- "5010:5010" | ||
volumes: | ||
- .:/app |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.