http://nodejs.osser.jp/server/nginx-max-performance/
- Nginxチューニング
- nginx最大限にスピードを出すために、設定パラメーターをチュニングしました。
- nginx設定例
user www-data;
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'] |
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 | |
} |
http://nodejs.osser.jp/server/nginx-max-performance/
user www-data;
func fib(num int) int { | |
if num <= 1 { | |
return num | |
} | |
return fib(num-2) + fib(num-1) | |
} |