2.1 KiB
Pro Se Litigant - Deployment Guide
This project is configured for deployment using Docker and GitHub Actions.
Prerequisites
- VPS with Docker and Docker Compose installed.
- GitHub Repository hosting this code.
- Domain Name (optional, but recommended for production).
Setup on VPS
-
Clone the repository (or copy
docker-compose.prod.yml,infrastructure/, anddeploy.shto your server).git clone <your-repo-url> cd pro-se-litigant -
Create a
.envfile based on.env.example.cp .env.example .env nano .envCritical variables to set:
DOCKER_IMAGE_OWNER: Your GitHub username (lowercase).POSTGRES_USER: Database username.POSTGRES_PASSWORD: Database password.JWT_SECRET: A secure random string.CORS_ORIGIN: Your frontend URL (e.g.,http://your-domain.com).NEXT_PUBLIC_API_URL: Your API URL (e.g.,http://your-domain.com/api).
-
Login to GitHub Container Registry (GHCR) You need a Personal Access Token (classic) with
read:packagesscope.echo <YOUR_PAT> | docker login ghcr.io -u <YOUR_GITHUB_USERNAME> --password-stdin -
Initial Deployment Run the deployment script:
chmod +x deploy.sh ./deploy.sh
CI/CD (GitHub Actions)
The repository includes workflows to automatically build and push Docker images to GHCR on every push to main.
.github/workflows/deploy-web.yml: Buildspro-se-litigant-web.github/workflows/deploy-api.yml: Buildspro-se-litigant-api
Automatic Deployment (Optional)
To enable automatic deployment to your VPS after build:
-
Add the following secrets to your GitHub Repository (Settings -> Secrets and variables -> Actions):
VPS_HOST: IP address of your VPS.VPS_USERNAME: SSH username (e.g.,rootorubuntu).VPS_SSH_KEY: Your private SSH key.
-
Create a new workflow
.github/workflows/deploy-vps.ymlthat usesappleboy/ssh-actionto run./deploy.shon your server.