From 3ebcec2b43958158c5cee33efaca90279252a167 Mon Sep 17 00:00:00 2001 From: devops Date: Mon, 30 Mar 2026 19:40:44 +0400 Subject: [PATCH] chore: add docker-compose, .gitignore and README Infrastructure files for staging deployment pipeline. The post-receive hook on the staging server will build and deploy automatically when PRs are merged to main. Made-with: Cursor --- .gitignore | 23 +++++++++++++++++++++++ README.md | 26 ++++++++++++++++++++++++++ docker-compose.yml | 9 +++++++++ 3 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0cf9bb --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Environment files — never commit secrets +.env +.env.* +!.env.example + +# Next.js +.next/ +out/ +node_modules/ + +# Build +dist/ +build/ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/README.md b/README.md new file mode 100644 index 0000000..4063640 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# EnCoach Frontend — v2 + +## Branching Workflow + +This repo is connected to the staging server via a Git post-receive hook. +**All deployment is automatic — but only after code review approval.** + +### How to contribute + +1. Never push directly to `main` — branch protection will block it. +2. Create a feature or fix branch: + ```bash + git checkout -b feature/your-feature-name + ``` +3. Develop, commit, and push your branch: + ```bash + git push origin feature/your-feature-name + ``` +4. Open a **Pull Request** on Gitea targeting `main`. +5. Request review from **devops (Talal)**. +6. Once approved and merged, the staging server rebuilds and redeploys automatically. + +### Environment + +The `.env` file is **not committed**. It lives only on the staging server at `/opt/encoach/frontend-v2/.env`. +Contact the team lead if you need a local copy of the environment variables. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b681093 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +services: + frontend: + build: . + image: encoach-frontend:latest + container_name: encoach-frontend + restart: unless-stopped + ports: + - "3000:3000" + env_file: .env