feat(docker): Add Consul to docker-compose and update documentation
- Add Consul service to docker-compose.yml - Running in dev mode on port 8500 - Health checks configured - Persistent volume for data - Web UI available at http://localhost:8500/ui - Update SUMMARY.md - Document Consul setup in docker-compose - Add Consul verification steps - Update prerequisites to include Docker Compose - Add note about Consul Web UI - Remove obsolete version field from docker-compose.yml
This commit is contained in:
@@ -141,9 +141,10 @@ auth:
|
||||
## Prerequisites
|
||||
|
||||
1. **PostgreSQL** running and accessible
|
||||
2. **Consul** running (for service discovery, optional but recommended)
|
||||
2. **Consul** running (for service discovery, required for service registry)
|
||||
3. **Go 1.24+** (or use `nix-shell` for development environment)
|
||||
4. **NixOS** (optional, for `shell.nix` development environment)
|
||||
5. **Docker and Docker Compose** (for running PostgreSQL and Consul)
|
||||
|
||||
## Building the Services
|
||||
|
||||
@@ -175,21 +176,35 @@ go build ./cmd/audit-service
|
||||
|
||||
## Running the Services
|
||||
|
||||
### 1. Start PostgreSQL
|
||||
### 1. Start PostgreSQL and Consul
|
||||
```bash
|
||||
# Using docker-compose (if available)
|
||||
docker-compose up -d postgres
|
||||
# Using docker-compose (recommended)
|
||||
docker-compose up -d postgres consul
|
||||
|
||||
# Or start PostgreSQL manually
|
||||
# Ensure database 'goplt' exists with user 'goplt' and password 'goplt_password'
|
||||
# Verify containers are running
|
||||
docker-compose ps
|
||||
|
||||
# Check logs
|
||||
docker-compose logs postgres
|
||||
docker-compose logs consul
|
||||
```
|
||||
|
||||
### 2. Start Consul (Optional)
|
||||
```bash
|
||||
# Using docker-compose
|
||||
docker-compose up -d consul
|
||||
The docker-compose.yml includes:
|
||||
- **PostgreSQL**: Available at `localhost:5432`
|
||||
- Database: `goplt`
|
||||
- User: `goplt`
|
||||
- Password: `goplt_password`
|
||||
- **Consul**: Available at `localhost:8500`
|
||||
- Running in dev mode
|
||||
- Web UI: http://localhost:8500/ui (for viewing registered services)
|
||||
- API: http://localhost:8500/v1
|
||||
|
||||
# Or start Consul manually
|
||||
### Alternative: Manual Setup
|
||||
```bash
|
||||
# Start PostgreSQL manually
|
||||
# Ensure database 'goplt' exists with user 'goplt' and password 'goplt_password'
|
||||
|
||||
# Start Consul manually
|
||||
consul agent -dev
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user