Fix Coolify startup and add GitHub-to-Gitea deploy walkthrough
This commit is contained in:
53
COOLIFY_GITEA_WALKTHROUGH.md
Normal file
53
COOLIFY_GITEA_WALKTHROUGH.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Coolify + Gitea Walkthrough
|
||||
|
||||
This repository is set up so:
|
||||
- `upstream` = GitHub source (`https://github.com/otangid/muslim-api.git`)
|
||||
- `origin` = your Gitea repo (`https://git.backoffice.biz.id/dwindown/muslim-api.git`)
|
||||
|
||||
## 1) One-time remote setup
|
||||
|
||||
Run from this repo root:
|
||||
|
||||
```bash
|
||||
git remote rename origin upstream
|
||||
git remote add origin https://git.backoffice.biz.id/dwindown/muslim-api.git
|
||||
git remote -v
|
||||
```
|
||||
|
||||
Expected:
|
||||
- `upstream` points to GitHub
|
||||
- `origin` points to Gitea
|
||||
|
||||
## 2) First push to Gitea
|
||||
|
||||
After your local commit is ready:
|
||||
|
||||
```bash
|
||||
git push -u origin main
|
||||
```
|
||||
|
||||
## 3) Command flow for each update
|
||||
|
||||
When GitHub has new commits and you want to redeploy via Coolify:
|
||||
|
||||
```bash
|
||||
git checkout main
|
||||
git fetch upstream
|
||||
git pull --ff-only upstream main
|
||||
git push origin main
|
||||
```
|
||||
|
||||
Coolify will redeploy when it detects the new commit on your Gitea branch.
|
||||
|
||||
## 4) Optional quick checks before push
|
||||
|
||||
```bash
|
||||
git status
|
||||
git log --oneline --decorate -n 5
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- App startup now does not require a physical `.env` file.
|
||||
- Server uses `PORT` from environment, with fallback to `3000`.
|
||||
- Configure your runtime environment variables in Coolify UI.
|
||||
2
app.js
2
app.js
@@ -30,8 +30,6 @@ app.use("/js", express.static(path.join(__dirname, "public/js")));
|
||||
app.use("/", apiRouter);
|
||||
app.use("/v1", apiV1Router);
|
||||
|
||||
// PW: dykq bppc wkon llmh
|
||||
|
||||
// catch 404 and forward to error handler
|
||||
app.use((req, res, next) => {
|
||||
next(createError(404));
|
||||
|
||||
2
bin/www
2
bin/www
@@ -12,7 +12,7 @@ var http = require("http");
|
||||
* Get port from environment and store in Express.
|
||||
*/
|
||||
|
||||
var port = normalizePort(process.env.PORT);
|
||||
var port = normalizePort(process.env.PORT || "3000");
|
||||
app.set("port", port);
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"description": "Quran, Doa, Dzikir, Hadits Api",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node --env-file=.env ./bin/www",
|
||||
"devstart": "DEBUG=dikiotang:* nodemon --env-file=.env ./bin/www"
|
||||
"start": "node ./bin/www",
|
||||
"devstart": "DEBUG=dikiotang:* nodemon ./bin/www"
|
||||
},
|
||||
"dependencies": {
|
||||
"body-parser": "^1.20.3",
|
||||
|
||||
Reference in New Issue
Block a user