|
| 1 | +# Hi.Events local development with Docker |
| 2 | + |
| 3 | +This guide walks you through setting up Hi.Events using Docker, including requirements, setup steps, configuration, |
| 4 | +and environment variables. |
| 5 | + |
| 6 | +## Requirements |
| 7 | + |
| 8 | +1. **Docker** – Required for containerized development. [Install Docker](https://docs.docker.com/get-docker/) |
| 9 | +2. **Git** – Needed to clone the repository. [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) |
| 10 | + |
| 11 | +> **Note:** This guide assumes a macOS or Linux environment by default. See the **Windows setup instructions** below if you're on Windows. |
| 12 | +
|
| 13 | +--- |
| 14 | + |
| 15 | +## Setup instructions (macOS / Linux) |
| 16 | + |
| 17 | +### 1. Clone the repository |
| 18 | + |
| 19 | +```bash |
| 20 | +git clone [email protected]:HiEventsDev/Hi.Events.git |
| 21 | +``` |
| 22 | + |
| 23 | +### 2. Start the development environment |
| 24 | + |
| 25 | +Navigate to the Docker development directory and run the startup script: |
| 26 | + |
| 27 | +```bash |
| 28 | +cd Hi.Events/docker/development |
| 29 | +./start-dev.sh |
| 30 | +``` |
| 31 | + |
| 32 | +Once running, access the app at: |
| 33 | + |
| 34 | +- **Frontend**: [https://localhost:8443](https://localhost:8443) |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## Setup instructions (Windows) |
| 39 | + |
| 40 | +Windows users should follow the steps below to manually run the setup commands instead of using the `start-dev.sh` script. |
| 41 | + |
| 42 | +### 1. Clone the repository |
| 43 | + |
| 44 | +Using Git Bash or Windows Terminal: |
| 45 | + |
| 46 | +```bash |
| 47 | +git clone [email protected]:HiEventsDev/Hi.Events.git |
| 48 | +cd Hi.Events/docker/development |
| 49 | +``` |
| 50 | + |
| 51 | +### 2. Generate SSL certificates |
| 52 | + |
| 53 | +You can use `openssl` to generate self-signed certificates: |
| 54 | + |
| 55 | +```bash |
| 56 | +mkdir -p certs |
| 57 | +openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout certs/localhost.pem.key -out certs/localhost.pem -subj "/CN=localhost" |
| 58 | +``` |
| 59 | + |
| 60 | +Then, update your `docker/development/nginx/nginx.conf` to use `.pem` files: |
| 61 | + |
| 62 | +```nginx |
| 63 | +ssl_certificate /etc/nginx/certs/localhost.pem; |
| 64 | +ssl_certificate_key /etc/nginx/certs/localhost.pem.key; |
| 65 | +``` |
| 66 | + |
| 67 | +> If you're using `.crt`/`.key`, update accordingly. |
| 68 | +
|
| 69 | +### 3. Start Docker services |
| 70 | + |
| 71 | +```bash |
| 72 | +docker-compose -f docker-compose.dev.yml up -d |
| 73 | +``` |
| 74 | + |
| 75 | +### 4. Install backend dependencies |
| 76 | + |
| 77 | +```bash |
| 78 | +docker-compose -f docker-compose.dev.yml exec -T backend composer install --ignore-platform-reqs --no-interaction --optimize-autoloader --prefer-dist |
| 79 | +``` |
| 80 | + |
| 81 | +### 5. Wait for the database |
| 82 | + |
| 83 | +Keep checking logs until you see "ready to accept connections": |
| 84 | + |
| 85 | +```bash |
| 86 | +docker-compose -f docker-compose.dev.yml logs pgsql |
| 87 | +``` |
| 88 | + |
| 89 | +### 6. Create environment files (if missing) |
| 90 | + |
| 91 | +```bash |
| 92 | +docker-compose -f docker-compose.dev.yml exec backend cp .env.example .env |
| 93 | +docker-compose -f docker-compose.dev.yml exec frontend cp .env.example .env |
| 94 | +``` |
| 95 | + |
| 96 | +### 7. Laravel setup |
| 97 | + |
| 98 | +```bash |
| 99 | +docker-compose -f docker-compose.dev.yml exec backend php artisan key:generate |
| 100 | +docker-compose -f docker-compose.dev.yml exec backend php artisan migrate |
| 101 | +docker-compose -f docker-compose.dev.yml exec backend chmod -R 775 /var/www/html/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer |
| 102 | +docker-compose -f docker-compose.dev.yml exec backend php artisan storage:link |
| 103 | +``` |
| 104 | + |
| 105 | +### 8. Open the app |
| 106 | + |
| 107 | +```bash |
| 108 | +start https://localhost:8443/auth/register |
| 109 | +``` |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +## Additional configuration |
| 114 | + |
| 115 | +Hi.Events uses environment variables for configuration. You’ll find `.env` files in: |
| 116 | + |
| 117 | +- `frontend/.env` |
| 118 | +- `backend/.env` |
| 119 | + |
| 120 | +You can modify these to customize your setup. |
| 121 | + |
| 122 | +For a full list of environment variables, see the [Environment Variables Documentation](https://hi.events/docs/getting-started/deploying#environment-variables). |
0 commit comments