Skip to content

Instantly share code, notes, and snippets.

FROM node:13
WORKDIR /app
COPY ./app/package*.json ./
COPY ./app/yarn.lock ./
# Install production dependencies.
RUN yarn install --production
steps:
# Build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/todo-notify', '-f', 'Dockerfile.prod', '.']
# Push the image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/todo-notify']
# Deploy image to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args: ['beta', 'run', 'deploy', 'todo-notify', '--image', 'gcr.io/$PROJECT_ID/todo-notify', '--region', 'us-central1', '--platform', 'managed']
@0xkohe
0xkohe / Clean-Architecture-with-InversifyJS.ts
Last active August 24, 2024 07:07
Clean Architecture with InversifyJS
import { firestore } from 'firebase'
import { injectable, inject, Container } from 'inversify'
import { db } from '@/plugins/firebase'
import 'reflect-metadata'
class RestaurantDataModel {
constructor(init: any) {
this.id = init.id || this.id
this.clientUID = init.clientUID || this.clientUID
this.content = init.content || this.content
name: Deploy Production
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
resource "aws_s3_bucket" "site" {
bucket = var.bucket_name
acl = "private"
tags = {
name = var.tag
}
force_destroy = true
versioning {
enabled = true
locals {
s3_origin_id = "s3-origin-${var.site_domain}"
}
resource "aws_cloudfront_origin_access_identity" "site" {
comment = var.site_domain
}
resource "aws_cloudfront_distribution" "site" {
tags = {
data "aws_route53_zone" "root_domain" {
name = var.root_domain
}
resource "aws_route53_zone" "sub_domain" {
name = var.site_domain
tags = {
name = var.tag
}
}
resource "aws_acm_certificate" "acm_cert" {
provider = aws.us-east-1
domain_name = var.root_domain
subject_alternative_names = ["*.${var.root_domain}"]
validation_method = "DNS"
lifecycle {
create_before_destroy = true
}
@0xkohe
0xkohe / gist:0d302420f57a4a1f930f438911474908
Created July 13, 2020 10:20
(コピペ)nginx最大パフォーマンスを出すための基本設定

http://nodejs.osser.jp/server/nginx-max-performance/

nginx最大パフォーマンスを出すための基本設定

  • Nginxチューニング
  • nginx最大限にスピードを出すために、設定パラメーターをチュニングしました。
  • nginx設定例
user www-data;
func fib(num int) int {
if num <= 1 {
return num
}
return fib(num-2) + fib(num-1)
}