Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ objects:
failureThreshold: 3
livenessProbe:
httpGet:
path: /api/health
path: /api
port: http
periodSeconds: 10
failureThreshold: 3
Expand Down
4 changes: 2 additions & 2 deletions backend/src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('AppController', () => {
})

describe('root', () => {
it('should return "Hello Backend!"', () => {
expect(appController.getHello()).toBe('Hello Backend!')
it('should return "Backend is live!"', () => {
expect(appController.getHello()).toBe('Backend is live!')
})
})
})
2 changes: 1 addition & 1 deletion backend/src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { Injectable } from '@nestjs/common'
@Injectable()
export class AppService {
getHello(): string {
return 'Hello Backend!'
return 'Backend is live!'
}
}
2 changes: 1 addition & 1 deletion backend/src/prisma.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PrismaService extends PrismaClientWithLogs implements OnModuleInit, OnModu
return PrismaService.instance
}
const pool = new Pool({ connectionString: dataSourceURL })
const adapter = new PrismaPg(pool)
const adapter = new PrismaPg(pool, { schema: DB_SCHEMA })
super({
adapter,
errorFormat: 'pretty',
Expand Down
2 changes: 1 addition & 1 deletion backend/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ describe('AppController (e2e)', () => {
await app.init()
})

it('/ (GET)', () => request(app.getHttpServer()).get('/').expect(200).expect('Hello Backend!'))
it('/ (GET)', () => request(app.getHttpServer()).get('/').expect(200).expect('Backend is live!'))
})
18 changes: 10 additions & 8 deletions common/openshift.database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ objects:
readinessProbe:
exec:
command:
- /usr/bin/env
- bash
- "-c"
- psql -q -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1'
- pg_isready
- -d
- $(POSTGRES_DB)
- -U
- $(POSTGRES_USER)
successThreshold: 1
failureThreshold: 5
initialDelaySeconds: 15
Expand All @@ -106,10 +107,11 @@ objects:
livenessProbe:
exec:
command:
- /usr/bin/env
- bash
- "-c"
- psql -q -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1'
- pg_isready
- -d
- $(POSTGRES_DB)
- -U
- $(POSTGRES_USER)
successThreshold: 1
failureThreshold: 5
initialDelaySeconds: 30
Expand Down
45 changes: 39 additions & 6 deletions frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,46 @@ objects:
matchLabels:
deployment: ${NAME}-${ZONE}-${COMPONENT}
topologyKey: kubernetes.io/hostname
initContainers:
- name: wait-for-backend
image: ${REGISTRY}/${ORG_NAME}/${NAME}/${COMPONENT}:${IMAGE_TAG}
command:
- /bin/sh
- -c
- |
echo "Waiting for backend to be healthy..."
max_retries=30
attempt=1
until wget -q --spider http://${NAME}-${ZONE}-backend/api/health; do
if [ "$attempt" -ge "$max_retries" ]; then
echo "ERROR: Backend ${NAME}-${ZONE}-backend is not reachable/healthy after ${max_retries} attempts." >&2
exit 1
fi
echo "Backend not ready (attempt ${attempt}/${max_retries}), sleeping..."
attempt=$((attempt + 1))
sleep 2
done
echo "Backend is UP and healthy!"
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefault
volumeMounts:
- name: caddy-data
mountPath: /tmp/caddy
containers:
- name: ${NAME}
image: ${REGISTRY}/${ORG_NAME}/${NAME}/${COMPONENT}:${IMAGE_TAG}
imagePullPolicy: Always
ports:
- name: http
containerPort: 3000
- name: health
containerPort: 3001
env:
- name: LOG_LEVEL
value: ${LOG_LEVEL}
Expand Down Expand Up @@ -109,20 +142,20 @@ objects:
mountPath: /tmp/coraza
startupProbe:
httpGet:
path: /
port: http
path: /health
port: health
periodSeconds: 5
failureThreshold: 30
readinessProbe:
httpGet:
path: /
port: http
path: /health
port: health
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /
port: http
path: /health
port: health
periodSeconds: 10
failureThreshold: 3
lifecycle:
Expand Down
Loading