opnform-host-nginx/docs/deployment/local-deployment.mdx

75 lines
2.3 KiB
Plaintext
Raw Normal View History

---
title: "Local Deployment"
description: "Set up OpnForm locally for development"
---
import CloudVersion from "/snippets/cloud-version.mdx";
<CloudVersion/>
Developer docker setup (#683) * Add build context to compose Signed-off-by: Daniel Ekman <knegge@gmail.com> * Update Docker documentation with build instructions Enhance Docker deployment documentation by: - Adding detailed instructions for building Docker images - Providing two methods for image building (Docker Compose and manual) - Clarifying how to use local images with docker-compose.override.yml * Add development Docker configuration Introduce development-specific Docker configuration: - Create docker-compose.dev.yml for local development setup - Add nginx.dev.conf with development CORS settings - Update Dockerfile.api to support environment-specific dependency installation - Configure development services with appropriate volumes and environment variables * Improve Docker and Development Documentation - Remove platform-specific ARM64 constraints in docker-compose.dev.yml - Enhance Nginx configuration with improved proxy and HMR settings - Update documentation for development setup and Docker deployment - Add new Docker development documentation page - Refactor getting started guide with clearer development instructions * Enhance Docker configuration and CI/CD pipeline - Update Docker Compose files with improved service configurations - Add database healthcheck in docker-compose.yml - Refactor GitHub Actions workflow for Docker image publishing - Optimize Dockerfile.api with multi-stage build and environment-specific configurations - Update Nginx configuration for development and production environments * Add GitHub Actions permissions for Docker image publishing Configure GitHub Actions workflow with explicit read and write permissions for content and packages to improve security and clarity of Docker image deployment process --------- Signed-off-by: Daniel Ekman <knegge@gmail.com> Co-authored-by: Daniel Ekman <knegge@gmail.com>
2025-01-28 17:52:48 +01:00
## Docker Development Setup (Recommended)
We recommend using our Docker-based development environment for the easiest setup experience. It provides hot-reload, debugging support, and all necessary services pre-configured.
See our [Docker Development Setup](/deployment/docker-development) guide to get started with Docker.
## Manual Setup
If you prefer to set up OpnForm manually or can't use Docker, follow the instructions below.
## Requirements
Before proceeding with the local deployment, ensure you have the following prerequisites installed on your system:
- **PHP**: Version 8.0 or higher
- **Composer**: The PHP dependency manager
- **Node.js**: Version 14 or higher
- **NPM** or **Yarn**: Package managers for Node.js
- **MySQL**, or **PostgreSQL**: A supported database system
Make sure these components are properly installed and configured on your local machine before proceeding with the deployment steps.
## Local setup
1. Install Laravel Herd -Download and install Laravel Herd from the official website: https://herd.laravel.com/
2. Clone the repository and install dependencies:
```bash
git clone https://github.com/JhumanJ/opnform && cd OpnForm
cd api && composer install
cd ../client && npm install
```
3. Compile assets and run dev server:
```bash
cd client && npm run dev # or build
```
4. Set up environment files:
```bash
./scripts/setup-env.sh
```
This script will create the necessary `.env` files for both the API and client.
5. Run the migrations:
```bash
cd api
php artisan migrate
```
6. Set up Herd:
For detailed instructions on setting up Herd, refer to the [Herd documentation](https://herd.laravel.com/docs).
- Open the Herd application
- Add your OpnForm's `api` directory to Herd
- Herd will automatically configure a local domain for your project
This will start the Nuxt.js development server, typically on `http://localhost:3000`.
8. Access your local OpnForm installation:
- The API will be available at the domain provided by Herd (e.g., `http://opnform.test`)
- The frontend will be accessible at `http://localhost:3000`