Coder Social home page Coder Social logo

ysv's Introduction

1. Create S3 PUBLIC Bucket, with:

  • Access control list (ACL): Everyone - can Read
  • Bucket policy: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "", "Action": [ "s3:PutObject", "s3:PutObjectAcl", "s3:GetObject", "s3:GetObjectAcl", "s3:AbortMultipartUpload" ], "Resource": [ "arn:aws:s3:::ysv-dev", "arn:aws:s3:::ysv-dev/" ] } ] }

then fisrt upload the pics in frontend/public/img to this Bucket. Note that you need to upload folder: upload all img folder at a time. By that, pic in S3 will have object name with prefix /img/

2. Create Cloudfront distribution: origin is the bucket above

3. Clone the repo, install docker, docker compose then continue config

4. Config docker-compose.env file:

FRONTEND_DOMAIN - the domain of frontend

POSTGRES_URL=postgresql+asyncpg://:@:5432/ POSTGRES_USER= POSTGRES_PASSWORD= POSTGRES_SERVER= POSTGRES_DB=

FIRST_ADMIN_EMAIL= - this will be client admin email to login FIRST_ADMIN_PASSWORD= - this will be password to login to admin site. Admin can change password later

AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_S3_REGION= AWS_S3_BUCKET= - bucket name, not whole url AWS_CLOUDFRONT_DISTRIBUTION_DOMAIN - cloudfront domain NUXT_PUBLIC_CLOUDFRONT_DISTRIBUTION_DOMAIN - cloudfront domain, same as above but for frontend NUXT_PUBLIC_API_BASE - the domain where host API. please create a DNS record with name api, so we will have for example https://api.domain.com. NUXT_PUBLIC_S3_BASE_URL - S3 whole url, for example https://ysv-dev.s3.ap-northeast-1.amazonaws.com

STRIPE_API_KEY=<stripe_api_key> STRIPE_ENDPOINT_SECRET=

MAIL_USERNAME=[email protected] - for SMTP gmail MAIL_PASSWORD= - app password from gmail MAIL_FROM=[email protected] - gmail name MAIL_PORT=587 MAIL_SERVER=smtp.gmail.com MAIL_FROM_NAME= - admin name

5. Config Caddy server:

Simple replace pxh-dev.online in my Caddy file by your domain, and use your email in tls You have to add a DNS record with name api, before doing this step.

5. Run:

docker compose up -d --build

ysv's People

Contributors

huongphamx avatar

Watchers

 avatar

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.