Skip to content

Commit 11f3e7c

Browse files
committed
chore: simplify deployment and fix environment
Signed-off-by: Ruben Romero Montes <[email protected]>
1 parent ae55a13 commit 11f3e7c

File tree

5 files changed

+41
-82
lines changed

5 files changed

+41
-82
lines changed

deploy/README-docker.md

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
This directory contains Docker Compose files for local development deployment of Trustify with its required infrastructure components.
44

5+
**Note**: Replace `docker-compose` with `podman-compose` if you're using Podman instead.
6+
57
## Files
68

79
- `docker-compose.infrastructure.yml` - Infrastructure services (Redis, PostgreSQL)
8-
- `docker-compose.infra-sso.yml` - Infrastructure services (Keycloak)
910
- `docker-compose.application.yml` - Application service (trust-da)
1011
- `env.example` - Environment variables template
1112

@@ -17,9 +18,6 @@ This directory contains Docker Compose files for local development deployment of
1718
# Start Redis, PostgreSQL, and Keycloak
1819
docker-compose -f docker-compose.infrastructure.yml up -d
1920

20-
# Start Keycloak
21-
docker-compose -f docker-compose.infra-sso.yml up -d
22-
2321
# Check if services are healthy
2422
docker-compose -f docker-compose.infrastructure.yml ps
2523
```
@@ -34,7 +32,13 @@ cp env.example .env
3432
nano .env
3533
```
3634

37-
### 3. Start Application
35+
### 3. Create Network
36+
37+
```bash
38+
docker network create trustify-network
39+
```
40+
41+
### 4. Start Application
3842

3943
```bash
4044
# Start the trust-da application
@@ -52,7 +56,6 @@ docker-compose -f docker-compose.application.yml ps
5256
|---------|------|-------------|
5357
| Redis | 6379 | Cache and session storage |
5458
| PostgreSQL | 5432 | Database for Keycloak and application |
55-
| Keycloak | 8080 | Identity and access management |
5659

5760
### Application Services
5861

@@ -64,15 +67,12 @@ docker-compose -f docker-compose.application.yml ps
6467
## Access Points
6568

6669
- **Application**: http://localhost:8081
67-
- **Keycloak Admin**: http://localhost:8080
68-
- Username: `admin`
69-
- Password: `admin123`
7070
- **PostgreSQL**: localhost:5432
7171
- Database: `trustify`
7272
- Username: `trustify`
7373
- Password: `trustify123`
7474
- **Redis**: localhost:6379
75-
- Password: `trustify123`
75+
- No authentication required
7676

7777
## Health Checks
7878

@@ -82,9 +82,6 @@ All services include health checks. You can monitor them with:
8282
# Check infrastructure health
8383
docker-compose -f docker-compose.infrastructure.yml ps
8484

85-
# Check Keycloak health
86-
docker-compose -f docker-compose.infra-sso.yml ps
87-
8885
# Check application health
8986
docker-compose -f docker-compose.application.yml ps
9087
```
@@ -95,9 +92,6 @@ docker-compose -f docker-compose.application.yml ps
9592
# View infrastructure logs
9693
docker-compose -f docker-compose.infrastructure.yml logs -f
9794

98-
# View Keycloak logs
99-
docker-compose -f docker-compose.infra-sso.yml logs -f
100-
10195
# View application logs
10296
docker-compose -f docker-compose.application.yml logs -f
10397

@@ -110,14 +104,11 @@ docker-compose -f docker-compose.application.yml logs -f trust-da
110104
```bash
111105
# Stop application
112106
docker-compose -f docker-compose.application.yml down
113-
# Stop Keycloak
114-
docker-compose -f docker-compose.infa-sso.yml down
115107
# Stop infrastructure
116108
docker-compose -f docker-compose.infrastructure.yml down
117109

118110
# Stop everything and remove volumes
119111
docker-compose -f docker-compose.infrastructure.yml down -v
120-
docker-compose -f docker-compose.infra-sso.yml down
121112
docker-compose -f docker-compose.application.yml down
122113
```
123114

@@ -132,14 +123,22 @@ To reset all data:
132123
docker-compose -f docker-compose.infrastructure.yml down -v
133124
```
134125

126+
## Remove the network
127+
128+
```bash
129+
docker network rm trustify-network
130+
```
131+
135132
## Environment Variables
136133

137134
Create a `.env` file based on `env.example` to customize:
138135

136+
- `TRUSTIFY_HOST`: Your Trustify server host
139137
- `TRUSTIFY_CLIENT_ID`: Your Trustify client ID
140138
- `TRUSTIFY_CLIENT_SECRET`: Your Trustify client secret
141-
- `SENTRY_DSN`: Sentry DSN for error tracking
142-
- `TELEMETRY_WRITE_KEY`: Telemetry write key
139+
- `TRUSTIFY_AUTH_SERVER_URL`: The Trustify SSO Server URL
140+
- `SENTRY_DSN`: Sentry DSN for error tracking (Optional)
141+
- `TELEMETRY_WRITE_KEY`: Telemetry write key (Optional)
143142

144143
## Troubleshooting
145144

@@ -154,21 +153,3 @@ docker-compose -f docker-compose.application.yml logs
154153
docker-compose -f docker-compose.infrastructure.yml restart
155154
docker-compose -f docker-compose.application.yml restart
156155
```
157-
158-
### Port conflicts
159-
160-
If you have port conflicts, modify the port mappings in the compose files:
161-
162-
```yaml
163-
ports:
164-
- "8082:8080" # Change 8081 to 8082
165-
```
166-
167-
### Network issues
168-
169-
The application uses an external network. If you encounter network issues:
170-
171-
```bash
172-
# Create the network manually
173-
docker network create trustify-network
174-
```

deploy/docker-compose.application.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
version: '3.8'
2-
31
services:
42
trust-da:
5-
image: trust-da:latest
3+
image: ${TRUST_DA_IMAGE:-trust-da:latest}
64
container_name: trustify-trust-da
5+
env_file:
6+
- .env
77
ports:
8-
- "8081:8080" # Application port
9-
- "9001:9000" # Management port
8+
- "8080:8080" # Application port
9+
- "9000:9000" # Management port
1010
environment:
1111
# Monitoring
1212
MONITORING_ENABLED: "false"
1313

1414
# Database
1515
DB_REDIS_HOST: redis
1616
DB_REDIS_PORT: 6379
17+
DB_POSTGRES_HOST: postgres
18+
DB_POSTGRES_PORT: 5432
19+
DB_POSTGRES_DATABASE: trustify
20+
DB_POSTGRES_USER: trustify
21+
DB_POSTGRES_PASSWORD: trustify123
22+
API_ONGUARD_DISABLED: true
1723

1824
# Trustify
19-
TRUSTIFY_HOST: ${TRUSTIFY_HOST:-https://rhtpa.stage.devshift.net/api/v2/}
20-
TRUSTIFY_CLIENT_ID: ${TRUSTIFY_CLIENT_ID:-your-trustify-client-id}
21-
TRUSTIFY_CLIENT_SECRET: ${TRUSTIFY_CLIENT_SECRET:-your-trustify-client-secret}
22-
TRUSTIFY_AUTH_SERVER_URL: http://keycloak:8080
23-
depends_on:
24-
redis:
25-
condition: service_healthy
26-
keycloak:
27-
condition: service_healthy
25+
PROVIDER_TRUSTIFY_HOST: ${TRUSTIFY_HOST:-https://trustify.example.com/api/v2/}
26+
PROVIDER_TRUSTIFY_AUTH_CLIENT_ID: ${TRUSTIFY_CLIENT_ID:-your-trustify-client-id}
27+
PROVIDER_TRUSTIFY_AUTH_CLIENT_SECRET: ${TRUSTIFY_CLIENT_SECRET:-your-trustify-client-secret}
28+
PROVIDER_TRUSTIFY_AUTH_SERVER_URL: ${TRUSTIFY_AUTH_SERVER_URL:-http://sso-trustify.example.com:8090}
2829
healthcheck:
2930
test: ["CMD", "curl", "-f", "http://localhost:9000/q/health/ready"]
3031
interval: 30s

deploy/docker-compose.infra-sso.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

deploy/docker-compose.infrastructure.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.8'
2-
31
services:
42
redis:
53
image: redis:8-alpine
@@ -8,9 +6,6 @@ services:
86
- "6379:6379"
97
volumes:
108
- redis_data:/data
11-
environment:
12-
- REDIS_PASSWORD=trustify123
13-
command: redis-server --requirepass trustify123
149
healthcheck:
1510
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
1611
interval: 30s
@@ -37,3 +32,8 @@ services:
3732
volumes:
3833
redis_data:
3934
postgres_data:
35+
36+
networks:
37+
default:
38+
name: trustify-network
39+
external: true

deploy/env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
TRUSTIFY_HOST=http://trustify.example.com/api/v2/
33
TRUSTIFY_CLIENT_ID=your-trustify-client-id
44
TRUSTIFY_CLIENT_SECRET=your-trustify-client-secret
5+
TRUSTIFY_AUTH_SERVER_URL=https://sso-trustify.example.com/auth/realms/trustify

0 commit comments

Comments
 (0)