Giter Club home page Giter Club logo

chronos's Introduction

chronos

Build

$ COMPOSE_DOCKER_CLI_BUILD=1 docker-compose build

Build docker image for production.

$ docker build -f Dockerfile.prod --secret id=master_key,src=config/master.key .

Dev

$ docker-compose up -d

AWS

IAM Policy

IAM policy for Copilot deployment.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:*",
                "servicediscovery:*",
                "route53domains:*",
                "s3:*",
                "ssm:*",
                "ecs:*",
                "lambda:*",
                "route53:*",
                "cloudformation:*",
                "ecr:*",
                "ec2:*"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": "sts:AssumeRole",
            "Resource": "*"
        }
    ]
}

Nginx

Build Nginx docker image, and push to ECR.

./scripts/ecr-nginx.sh

Copilot

Create AWS resources (ex. VPC, ALB, Farge, RDS) with AWS Copilot.

$ ./scripts/copilot-init.sh <env> <domain>

Shared EFS

To share EFS between services, fetch EFS configuration from copilot commands bellow.

$ FS_ID=$(copilot env show -n dev --json --resources | jq -r '.resources[] | select(.type | contains("EFS::FileSystem")) | .physicalID')
$ FS_AP=$(copilot svc show -n rails --json --resources | jq -r '.resources.dev[] | select(.type | contains("EFS::AccessPoint")) | .physicalID')

And set these values to storage section.

storage:
  volumes:
    sharedEFS:
      efs:
        id: $FS_ID
        auth:
          access_point_id: $FS_AP
          iam: true
      path: /app/public/maintenance
      read_only: false

Switch maintenance

# turn on maintenance mode
$ copilot svc exec --app chronos --command 'bin/maintenance on'

# turn off maintenance mode
$ copilot svc exec --app chronos --command 'bin/maintenance off'

Cleaning

$ ./scripts/copilot-delete.sh

Deployment

Running a deployment workflow using GitHub CLI.

./scripts/deploy.sh -h
Usage: ./scripts/deploy.sh [flags]

    -r, --rails          Deploy Rails
    -n, --nuxt           Deploy Nuxt
    -m, --maintenance    Maintenance mode on
    --branch string      Deploy branch name
    --env string         Deploy environment. dev | staging | production

chronos's People

Contributors

shgtkshruch avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

chronos's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.