4 Commits
Author SHA1 Message Date
hermes ea0e4eb018 Added image name to compose file for console 2026-09-11 16:23:50 +02:00
hermes 9ebbafb840 Added more cors origins 2026-09-11 16:16:41 +02:00
hermes f3863c785d Refactored console dockerfile 2026-09-11 16:04:54 +02:00
hermes 9874eac65d Fixed dockerfile paths 2026-09-11 15:47:02 +02:00
3 changed files with 22 additions and 13 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ builder.Services.AddOpenApi(options =>
}); });
builder.Services.AddCors(options => options.AddPolicy("AllowFrontend", policy => builder.Services.AddCors(options => options.AddPolicy("AllowFrontend", policy =>
policy.WithOrigins("https://localhost:3000").AllowAnyHeader().AllowAnyMethod().AllowCredentials())); policy.WithOrigins("https://localhost:3000", "https://localhost:8076", "https://console.ifri.khongisa.co.za")
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials()));
var app = builder.Build(); var app = builder.Build();
+16 -11
View File
@@ -3,29 +3,34 @@ FROM node:20-alpine AS builder
WORKDIR /app WORKDIR /app
# Copy dependency definitions # Enable corepack to use Yarn
COPY package*.json ./ RUN corepack enable
# Install dependencies # Copy dependency definitions from the subdirectory
RUN npm ci || npm install COPY PostFundManagement.ConsoleUI/package*.json PostFundManagement.ConsoleUI/yarn.lock* ./
# Copy application source # Install dependencies via Yarn
COPY . . RUN yarn install --frozen-lockfile || yarn install
# Copy application source from the subdirectory
COPY PostFundManagement.ConsoleUI/ ./
# Build Vite application for production # Build Vite application for production
RUN npm run build RUN yarn build
# Stage 2: Production Nginx Server # Stage 2: Production Nginx Server
FROM nginx:alpine FROM nginx:alpine
# Copy nginx configuration WORKDIR /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy nginx configuration from stage 1 build directory
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf
# Copy compiled static assets from build stage # Copy compiled static assets from build stage
COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/dist ./
# Copy entrypoint script for dynamic runtime environment variables # Copy entrypoint script for dynamic runtime environment variables
COPY docker-entrypoint.sh /docker-entrypoint.sh COPY --from=builder /app/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh
# Expose port 3000 # Expose port 3000
+1
View File
@@ -68,6 +68,7 @@ services:
# Redis overrides # Redis overrides
- ConnectionStrings__Redis=${REDIS_CONNECTION_STRING:-192.168.1.171:6379,ssl=false,abortConnect=false} - ConnectionStrings__Redis=${REDIS_CONNECTION_STRING:-192.168.1.171:6379,ssl=false,abortConnect=false}
pfm-console: pfm-console:
image: pfm-console
build: build:
context: . context: .
dockerfile: PostFundManagement.ConsoleUI/Dockerfile dockerfile: PostFundManagement.ConsoleUI/Dockerfile