https://github.com/beastop/payloadcms-template
https://github.com/beastop/payloadcms-template
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/beastop/payloadcms-template
- Owner: beastOP
- Created: 2023-03-09T18:42:57.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-31T15:54:02.000Z (about 3 years ago)
- Last Synced: 2025-02-25T09:29:23.472Z (over 1 year ago)
- Language: TypeScript
- Size: 148 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The payloadcms-template
This template is setup with gcs and smtp to handle media storage and emails. This project is configured to be deployed to gcp app engine.
## Local development requirement
- Docker
- Google cloud SDK
## How to start the dev server
First you'll need to build the docker image which depends on your gcp service account json key, storage bucket name, and project id.
You can configure the SMTP env directly in the Docker file if you want.
I you are using a mongodb docker image you'll need to create a network bridge and run your mongo image inside it (e.g. `docker start mongodb --network mybridge`).
Then you can run the docker image with:
```
docker run --name my-blog -p 3000:3000 --network mybridge -e MONGODB_URI=mongodb://mongo:27017/my-blog -e PAYLOAD_SECRET= -e SMTP_HOST= -e SMTP_USER= SMTP_PASS=
```
or you can add all the env inside a `.env.local` file and run
```
docker run --name my-blog --env-file .env.local -p 3000:3000
```
### Environment variables for application
- `GCS_BUCKET`
- `GCS_PROJECT_ID`
- `GCS_PROJECT_ID`
- `PAYLOAD_SECRET`
- `MONGODB_URI`
- `SMTP_HOST`
- `SMTP_USER`
- `SMTP_PASS`
You'll need to enable the container register api in GCP for this project and create a service account key json and add its contents to github secrets variable `SERVICE_ACCOUNT_KEY`. The first build might take around 5 mins but the subsequent build are fast.