53 lines
1.2 KiB
Markdown
53 lines
1.2 KiB
Markdown
# Local Development with Docker Swarm
|
|
|
|
This directory contains the configuration to run the Evrak application locally using Docker Swarm on Windows 11.
|
|
|
|
## Prerequisites
|
|
|
|
1. **Docker Desktop**: Ensure Docker Desktop is installed and running.
|
|
2. **Swarm Mode**: Enable Swarm mode if not already enabled:
|
|
```powershell
|
|
docker swarm init
|
|
```
|
|
|
|
## How to Deploy
|
|
|
|
### 1. Build Images
|
|
First, build the Docker images locally. `docker stack deploy` does not build images, so this step is required.
|
|
|
|
```powershell
|
|
docker compose -f deploy/local/docker-compose.yml build
|
|
```
|
|
|
|
### 2. Deploy to Swarm
|
|
Deploy the stack to your local Swarm cluster.
|
|
|
|
```powershell
|
|
docker stack deploy -c deploy/local/docker-compose.yml evrak
|
|
```
|
|
|
|
### 3. Verify
|
|
Check if the services are running:
|
|
|
|
```powershell
|
|
docker service ls
|
|
docker stack ps evrak
|
|
```
|
|
|
|
Access the application:
|
|
* **Frontend**: http://localhost
|
|
* **Backend API**: http://localhost:3000
|
|
* **Database**: localhost:5432
|
|
|
|
### 4. Remove Stack
|
|
To stop and remove the application:
|
|
|
|
```powershell
|
|
docker stack rm evrak
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
* **Image not found**: Make sure you ran the build step.
|
|
* **Ports occupied**: Ensure ports 80, 3000, and 5432 are free on your host machine.
|