-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.internal-server
More file actions
34 lines (25 loc) · 1 KB
/
Dockerfile.internal-server
File metadata and controls
34 lines (25 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Stage 1: Build the Angular application
FROM node:22-alpine AS builder
LABEL stage="builder"
WORKDIR /app
# Copy package files and install dependencies
# Using --legacy-peer-deps as your project might have peer dependency conflicts
COPY package.json package-lock.json* ./
RUN npm install -g pnpm && pnpm i
# Copy the rest of the application source code
COPY . .
# Build the application for production
# Assumes output is in /app/dist/polilan (check angular.json if different)
RUN pnpm run build:internalnet
# Stage 2: Serve the application with Nginx
FROM nginx:1.27-alpine AS runner
LABEL stage="runner"
# Copy the built application from the builder stage to Nginx's webroot
# Adjust '/app/dist/polilan' if your angular.json outputPath is different
COPY --from=builder /app/www/browser /usr/share/nginx/html
# Copy the custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80 (Nginx default port)
EXPOSE 80
# Start Nginx when the container launches
CMD ["nginx", "-g", "daemon off;"]