CUB-64: Docker Runtime Setup for Development & Deployment #14
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user