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 .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Lint (ruff)
run: |
pip install ruff
ruff check .
ruff check . --show-files
- name: Run tests
run: pytest

Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ frontend/build/
frontend/.next/
frontend/out/

# Frontend Environment
frontend/.env.production
.env.prod

# Frontend logs
frontend/npm-debug.log*
frontend/yarn-debug.log*
Expand Down Expand Up @@ -90,5 +86,4 @@ docker-compose.prod.yml


# Environment variables
.env.production
!.env.example
24 changes: 2 additions & 22 deletions backend/app/.env.development
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
DEV_USER=user1
DB_PORT=5433
BACKEND_PORT=8001

# ============================================
# DATENBANK
# ============================================
POSTGRES_USER=user
POSTGRES_PASSWORD=dev_pass_user1
POSTGRES_DB=appdb_dev_user1

DB_READER_USER=reader
DB_READER_PASS=reader-pass
DB_ADMIN_USER=admin
DB_ADMIN_PASS=admin-pass

# ============================================
# BACKEND
# ============================================
DATABASE_URL=postgresql://user:dev_pass_user1@db:5432/appdb_dev_user1
LOG_LEVEL=INFO
IMAGE_DIR=/app/static/images
CORS_ORIGINS=http://localhost:3000
# CORS_ORIGINS=http://localhost:3001, http://localhost:8001, http://132.195.69.123:3001, http://132.195.69.123:8001, http://132.195.69.123:80, http://132.195.178.126
DATABASE_URL=postgresql://user:dev_pass_user1@db:5432/appdb_dev_user1
SECRET_KEY = "9a6f88adad60f8dc9cae15ea76b9e363a21a051020268f1b2158004ddd5160f4"

LOG_LEVEL=INFO
6 changes: 6 additions & 0 deletions backend/app/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BACKEND_PORT=8001
LOG_LEVEL=INFO
IMAGE_DIR=/app/static/images
CORS_ORIGINS=http://localhost:3000
DATABASE_URL=postgresql://user:dev_pass_user1@db:5432/appdb_dev_user1
SECRET_KEY = "changeme"
69 changes: 0 additions & 69 deletions docker-compose.dev2.yml

This file was deleted.

33 changes: 4 additions & 29 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,38 @@ services:
image: postgres:16
container_name: usecase-management_db-prod
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_USER: user
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
# ports:
# - "5432:5432" (kein Ports-Mapping = nur intern erreichbar)
volumes:
- db_data:/var/lib/postgresql/data
restart: unless-stopped
networks:
- app-network

backend:
build:
context: ./backend
dockerfile: Dockerfile
image: ghcr.io/project-construct-x/usecase-management-backend:latest
container_name: usecase-management_backend-prod
environment:
- DATABASE_URL=${DATABASE_URL}
- IMAGE_DIR=${IMAGE_DIR}
- ENV=${ENV}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS}
- DB_READER_USER=${DB_READER_USER}
- DB_READER_PASS=${DB_READER_PASS}
- DB_ADMIN_USER=${DB_ADMIN_USER}
- DB_ADMIN_PASS=${DB_ADMIN_PASS}
- SECRET_KEY=${SECRET_KEY}
APP_ENV: production
ports:
- "8000:8000"
depends_on:
- db
restart: unless-stopped
volumes:
# Kein Code-Mount in Production!
- static_images_volume:/app/static/images
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
networks:
- app-network

frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
image: ghcr.io/project-construct-x/usecase-management-frontend:latest
container_name: usecase-management_frontend-prod
ports:
- "80:80"
depends_on:
- backend
restart: unless-stopped
volumes:
- ./frontend/.htpasswd:/etc/nginx/.htpasswd:ro
networks:
- app-network

volumes:
db_data:
static_images_volume:

networks:
app-network:
driver: bridge
17 changes: 3 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ services:
POSTGRES_PASSWORD: dev_pass_user1
POSTGRES_DB: appdb_dev_user1
ports:
- "5432:5432" # NUR localhost!
- "5432:5432"
volumes:
- db_data_dev:/var/lib/postgresql/data
networks:
- app-network

backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: usecase-management_backend-user1
ports:
- "8080:8080" # NUR localhost!
- "8080:8080"
environment:
- APP_ENV=development
depends_on:
Expand All @@ -28,32 +26,23 @@ services:
- ./backend:/app
- static_images_volume_dev:/app/static/images
command: uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload
networks:
- app-network

frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: usecase-management_frontend-user1
ports:
- "3000:3000" # NUR localhost
- "3000:3000"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
command: npm run dev -- --host 0.0.0.0
networks:
- app-network

volumes:
db_data_dev:
name: usecase-management_db_data_dev_user1
static_images_volume_dev:
name: usecase-management_static_images_dev_user1

networks:
app-network:
name: usecase-management_network_user1
driver: bridge
1 change: 1 addition & 0 deletions frontend/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=https://usecase-management.staging.construct-x.net/api
8 changes: 5 additions & 3 deletions helm/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -euo pipefail

CLUSTER="borrmann-dev"
NAMESPACE="soundboard"
RELEASE="soundboard"
NAMESPACE="usecase-management-staging"
RELEASE="usecase-management"
CHART_DIR="$(dirname "$0")"

usage() {
Expand All @@ -15,7 +15,7 @@ Usage: $(basename "$0") <install|upgrade|delete>
delete Delete the release (keeps PVCs)

Requires a kubeconfig context named '${CLUSTER}'.
Run 'secrets.sh write' first to set Discord credentials in the cluster.
Run 'secrets.sh write' first to set credentials in the cluster.
EOF
exit 1
}
Expand All @@ -35,6 +35,7 @@ cmd_install() {
helm upgrade --install "${RELEASE}" "${CHART_DIR}" \
--namespace "${NAMESPACE}" \
--create-namespace \
--values "${CHART_DIR}/values-staging.yaml" \
--wait \
--timeout=5m \
"$@"
Expand All @@ -46,6 +47,7 @@ cmd_upgrade() {
check_context
helm upgrade "${RELEASE}" "${CHART_DIR}" \
--namespace "${NAMESPACE}" \
--values "${CHART_DIR}/values-staging.yaml" \
--wait \
--timeout=5m \
"$@"
Expand Down
59 changes: 0 additions & 59 deletions helm/secrets.sh

This file was deleted.

10 changes: 1 addition & 9 deletions helm/templates/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,12 @@ spec:
- containerPort: 8080
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: usecase-management-secret
key: DATABASE_URL
value: {{ printf "postgresql://%s:%s@usecase-management-db:5432/%s" .Values.db.user .Values.db.password .Values.db.db | quote }}
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: usecase-management-secret
key: SECRET_KEY
- name: ALLOWED_ORIGINS
valueFrom:
secretKeyRef:
name: usecase-management-secret
key: ALLOWED_ORIGINS
volumeMounts:
- name: static-images
mountPath: "/app/static/images"
Expand Down
Loading
Loading