strapi 2.3 KB

123456789101112131415161718192021222324252627282930
  1. # Deploy Strapi with Porter
  2. This is a quickstart repository you can fork to deploy Strapi to Kubernetes on AWS/GCP/DO with Porter. This sample repository uses PostgresDB by default. Modify the files in `/app/config/env/production` to customize your database settings.
  3. # Quick Deploy
  4. ## Deploying Strapi
  5. 1. Create an account on [Porter](https://dashboard.getporter.dev).
  6. 2. [One-click provision a Kubernetes cluster](https://docs.getporter.dev/docs/getting-started-with-porter-on-aws) in a cloud provider of your choice, or [connect an existing cluster.](https://docs.getporter.dev/docs/cli-documentation#connecting-to-an-existing-cluster)
  7. 3. Fork this repository.
  8. 4. From the [Launch tab](https://dashboard.getporter.dev/launch), navigate to **Web Service > Deploy from Git Repository**. Then select the forked repository and `Dockerfile` in the root directory.
  9. 5. Configure the port to `1337`, add environment variable `NODE_ENV=production`, and set resources to the [recommended settings](https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/deployment.html#general-guidelines) (i.e. 2048Mi RAM, 1000 CPU).
  10. 6. Hit Deploy!
  11. ## Deploying PostgresDB
  12. 1. Strapi instance deployed through Porter connects to PostgresDB. You can connect Strapi instance deployed on Porter to any external database, but it is also possible to use a database that is also deployed on Porter. Follow [this guide to deploy a PostgresDB instance to your cluster in one click](https://docs.getporter.dev/docs/postgresdb).
  13. 2. After the database has been deployed, navigate to the **Environment Variables** tab of your deployed Strapi instance. Configure the following environment variables:
  14. ```
  15. NODE_ENV=production
  16. DATABASE_HOST=
  17. DATABASE_PORT=5432
  18. DATABASE_NAME=
  19. DATABASE_USERNAME=
  20. DATABASE_PASSWORD=
  21. ```
  22. For details on how to connect to the deployed database, [see this guide](https://docs.getporter.dev/docs/postgresdb#connecting-to-the-database).
  23. # Development
  24. To develop, clone this repository to your local environment and run `npm install && npm run develop;` from the `app` directory. Porter will automatically handle CI/CD and propagate your changes to production on every push to the repository.
  25. # Questions?
  26. Join the [Porter Discord community](https://discord.gg/FaaFjb6DXA) if you have any questions or need help.