DEV Community

Cover image for Online-CV With Google-Cloud Run
πŸš€ Vu Dao πŸš€
πŸš€ Vu Dao πŸš€

Posted on

3 1

Online-CV With Google-Cloud Run

Inherit from the post pelican-resume with AWS EC2 this post shows how to create online-cv with gcloud-run

Source: https://github.com/vumdao/pelican-resume

1. Generate resume front-end output

docker run -v $PWD:/site vorakl/alpine-pelican pelican /site/content -o /site/output -s /site/pelicanconf.py
$ docker run -v $PWD:/site vorakl/alpine-pelican pelican /site/content -o /site/output -s /site/pelicanconf.py
WARNING: Feeds generated without SITEURL set properly may not be valid
WARNING: No valid files found in content for the active readers:
  | BaseReader (static)
  | HTMLReader (htm, html)
  | MarkdownReader (md, markdown, mkd, mdown)
  | RstReader (rst)
Done: Processed 0 articles, 0 drafts, 0 pages, 0 hidden pages and 0 draft pages in 0.09 seconds.
Enter fullscreen mode Exit fullscreen mode

2. Create nginx Dockerfile to create backend CV

# nginx state for serving content
FROM nginx:alpine
# Set working directory to nginx asset directory
WORKDIR /usr/share/nginx/html
# Remove default nginx static assets
RUN rm -rf ./*
COPY output .
# Containers run nginx with global directives and daemon off
EXPOSE 80
ENTRYPOINT ["nginx", "-g", "daemon off;"]
Enter fullscreen mode Exit fullscreen mode

3. Create cloud build yaml file

General Steps Of the build set

  • Build image
  • Push image to gcloud registry
  • gcloud deploy
steps: 
- name: 'gcr.io/cloud-builders/docker'
  args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/myresume', '.' ]
- name: 'gcr.io/cloud-builders/docker'
  args: ['push', 'gcr.io/$PROJECT_ID/myresume']
- name: 'gcr.io/cloud-builders/gcloud'
  args:
  - 'run'
  - 'deploy'
  - 'cloudrunservice'
  - '--image'
  - 'gcr.io/$PROJECT_ID/myresume'
  - '--region'
  - 'asia-southeast1'
  - '--platform' 
  - 'managed'
  - '--allow-unauthenticated'  
images:
- 'gcr.io/$PROJECT_ID/myresume'
Enter fullscreen mode Exit fullscreen mode

4. Build and Deploy

Get familiar with gcloud-build and gcloud-run through

Remember to add permission to the cloud build

Alt Text

gcloud builds submit --config cloudbuild.yaml
Enter fullscreen mode Exit fullscreen mode

Note

Alt Text

Alt Text

Result

Step #2: Service [cloudrunservice] revision [cloudrunservice-00002-fin] has been deployed and is serving 100 percent of traffic.
Step #2: Service URL: https://cloudrunservice-ytz2j3pyjq-as.a.run.app
Enter fullscreen mode Exit fullscreen mode

Alt Text

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here β†’

Top comments (0)

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more