cd
into backend
and :
poetry install
Then poetry shell
to activate the virtual env.
Then :
poetry run pre-commit install
to install the pre-commit hooks.
-
cd
into location ofDockerfile
. -
Build and tag the docker image:
docker buildx build --platform linux/amd64 -t us-central1-docker.pkg.dev/merantix-genai23ber-9525/alfred-cr/alfred-backend .
This makes sure the docker image is built for the amd64 architecture such that it runs on Google Platform, which might be different than the local machine's architecture.
-
Push the Docker image to Google Artifact Registry:
docker push us-central1-docker.pkg.dev/merantix-genai23ber-9525/alfred-cr/alfred-backend
-
Deploy the container to Cloud Run:
gcloud run deploy alfred-backend-service --image us-central1-docker.pkg.dev/merantix-genai23ber-9525/alfred-cr/alfred-backend
After building the docker image from step 2. in the above, run:
PORT=8080 && docker run -p 9090:${PORT} -e PORT=${PORT} us-central1-docker.pkg.dev/merantix-genai23ber-9525/alfred-cr/alfred-backend
Then navigate to http://127.0.0.1:9090/
.