Compare commits

...

2 Commits

Author SHA1 Message Date
afccda0eb9 Update documentation for local & prod setup
All checks were successful
continuous-integration/drone/push Build is passing
2024-01-24 16:57:22 +05:00
7f5b8e7aa5 create alternate docker compose file for local dev 2024-01-24 16:50:39 +05:00
2 changed files with 47 additions and 5 deletions

View File

@ -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.

31
docker-compose-local.yml Normal file
View File

@ -0,0 +1,31 @@
version: '3'
services:
payload:
image: node:21-bookworm
ports:
- '3000:3000'
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
working_dir: /home/node/app/
command: sh -c "yarn install && yarn dev"
depends_on:
- mongo
env_file:
- .env
mongo:
image: mongo:latest
ports:
- '27017:27017'
command:
- --storageEngine=wiredTiger
volumes:
- data:/data/db
logging:
driver: none
volumes:
data:
node_modules: