Compare commits

...

2 Commits

Author SHA1 Message Date
fd9fcd47ab Merge remote-tracking branch 'origin/dev' into fix-pr-14
Some checks failed
Dev Build / build-test (pull_request) Failing after 58s
Dev Build / deploy-dev (pull_request) Has been skipped
Dev Build / notify-success (pull_request) Has been skipped
Dev Build / notify-failure (pull_request) Successful in 3s
# Conflicts:
#	frontend/.dockerignore
#	frontend/Dockerfile
#	frontend/nginx.conf
2026-04-27 14:30:03 -04:00
61178ebb7b feat(CUB-64): Docker runtime setup for development & deployment
Some checks failed
Dev Build / build-test (pull_request) Failing after 47s
Dev Build / deploy-dev (pull_request) Has been skipped
Dev Build / notify-success (pull_request) Has been skipped
Dev Build / notify-failure (pull_request) Successful in 3s
- Backend Dockerfile: added curl install for health check (not in aspnet base image)
- Frontend Dockerfile: multi-stage Angular build with nginx serving
- Frontend nginx.conf: SPA routing, API proxy, SignalR WebSocket support, health endpoint
- Frontend .dockerignore: excludes node_modules, dist, .angular, etc.
- docker-compose.dev.yml: added PostgreSQL service, fixed frontend context path,
  renamed web service from control-center-web to extrudex-web, added DB env vars,
  proper service dependencies with health checks
- deploy.sh: updated service list to include PostgreSQL port
2026-04-27 08:33:18 +00:00
3 changed files with 41 additions and 7 deletions

View File

@@ -17,6 +17,9 @@ RUN dotnet publish Extrudex.csproj \
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app WORKDIR /app
# Install curl for health check (not included in aspnet base image)
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
# Non-root user for security # Non-root user for security
RUN adduser --disabled-password --gecos "" appuser RUN adduser --disabled-password --gecos "" appuser
USER appuser USER appuser

View File

@@ -18,13 +18,14 @@ echo "📦 Building and starting services..."
$COMPOSE_CMD -f docker-compose.dev.yml up -d --build $COMPOSE_CMD -f docker-compose.dev.yml up -d --build
echo "⏳ Waiting for services to become healthy..." echo "⏳ Waiting for services to become healthy..."
sleep 10 sleep 15
echo "✅ Deployment complete!" echo "✅ Deployment complete!"
echo "" echo ""
echo "Services running:" echo "Services running:"
echo " • PostgreSQL: localhost:5433"
echo " • Extrudex API: http://localhost:5080" echo " • Extrudex API: http://localhost:5080"
echo " • Control Center Web: http://localhost:5081" echo " • Extrudex Web: http://localhost:5081"
echo "" echo ""
echo "To view logs:" echo "To view logs:"
echo " $COMPOSE_CMD -f docker-compose.dev.yml logs -f" echo " $COMPOSE_CMD -f docker-compose.dev.yml logs -f"

View File

@@ -1,6 +1,25 @@
version: '3.8'
services: services:
extrudex-db:
image: postgres:16-alpine
container_name: extrudex-db
environment:
POSTGRES_USER: extrudex
POSTGRES_PASSWORD: changeme
POSTGRES_DB: extrudex
ports:
- "5433:5432"
volumes:
- extrudex-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U extrudex"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
networks:
- extrudex-network
extrudex-api: extrudex-api:
build: build:
context: ./backend context: ./backend
@@ -11,6 +30,14 @@ services:
environment: environment:
- ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=http://+:8080 - ASPNETCORE_URLS=http://+:8080
- EXTRUDEX_DB_HOST=extrudex-db
- EXTRUDEX_DB_PORT=5432
- EXTRUDEX_DB_NAME=extrudex
- EXTRUDEX_DB_USER=extrudex
- EXTRUDEX_DB_PASSWORD=changeme
depends_on:
extrudex-db:
condition: service_healthy
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
@@ -21,11 +48,11 @@ services:
networks: networks:
- extrudex-network - extrudex-network
control-center-web: extrudex-web:
build: build:
context: ../Control-Center/frontend context: ./frontend
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: control-center-web container_name: extrudex-web
ports: ports:
- "5081:80" - "5081:80"
depends_on: depends_on:
@@ -35,6 +62,9 @@ services:
networks: networks:
- extrudex-network - extrudex-network
volumes:
extrudex-db-data:
networks: networks:
extrudex-network: extrudex-network:
driver: bridge driver: bridge