Add BuildKit syntax directive and --network=host flag to npm install, go mod operations, and apk package installation to allow direct host network access during builds, bypassing Docker's default bridge network for improved reliability and performance of dependency downloads.
12 lines
278 B
Docker
12 lines
278 B
Docker
## syntax=docker/dockerfile:1.4
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package.json ./
|
|
RUN --network=host npm install
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM nginx:1.27-alpine
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|