blob: 37ee5b83e394fdf902621832169df993ba3815a0 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Stage 1: Build the Angular application
FROM node:24-alpine as build
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the application for production
RUN npm run build -- --configuration production
# Stage 2: Serve the application with Nginx
FROM nginx:stable-alpine
# Copy the build output to the Nginx html directory
COPY --from=build /app/dist/fineract-backoffice-ui/browser /usr/share/nginx/html
# Copy custom Nginx configuration
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
# Copy entrypoint script
COPY deploy/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Expose port 80
EXPOSE 80
# Use entrypoint to inject environment variables into config.json
ENTRYPOINT ["/entrypoint.sh"]
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]