From afccda0eb9d18e1df8997b14705e544d01af547f Mon Sep 17 00:00:00 2001 From: Aadil Ayub Date: Wed, 24 Jan 2024 16:57:22 +0500 Subject: [PATCH] Update documentation for local & prod setup --- README.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e9bfddd..5a8513f 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,23 @@ [![Build Status](https://drone.autonomic.zone/api/badges/ruangrupa/lumbung-kios-cms/status.svg?ref=refs/heads/main)](https://drone.autonomic.zone/ruangrupa/lumbung-kios-cms) -This project was created using create-payload-app using the ts-blank template. +This project was created using `npx create-payload-app` using the ts-blank template. -## How to Use +## Local development -`yarn dev` will start up your application and reload on any changes. Make sure to have mongodb running locally as well. +- First, create a `.env` file in the root, and populate it with these values: -## Deploy +``` +MONGODB_URI=mongodb://mongo:27017/lumbung-kios-cms +PAYLOAD_SECRET=5c8ac4a2cd754247f38ae726 +PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3000 +``` -Push commits, it will auto-deploy to [kios-admin.lumbung.space](https://kios-admin.lumbung.space). +- Run `docker-compose -f docker-compose-local.yml up` to get the application running locally. +- The application will have no data by default, so you will have to create your own test products, couriers, retailers, dispatches, and makers. + +## Deployment & production setup + +Push commits, it will auto-deploy to [kios-admin.lumbung.space](https://kios-admin.lumbung.space). CI/CD is powered by [Drone](https://drone.autonomic.zone/ruangrupa/lumbung-kios-cms), it uses the `Dockerfile` in the root project folder for builds. You can test builds locally using `docker build .`. + +The application is running on the `ruangrupa-dedi` server as a vanilla Docker swarm stack.