up
This commit is contained in:
+3
-17
@@ -1,19 +1,7 @@
|
||||
# ──────────────────────────────────────────
|
||||
# Stage 1: Build del frontend (assets JS/CSS)
|
||||
# ──────────────────────────────────────────
|
||||
FROM node:18-alpine AS frontend
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json webpack.mix.js postcss.config.js tailwind.config.js ./
|
||||
# Eliminar lock para que npm respete los overrides de package.json
|
||||
RUN rm -f package-lock.json && npm install --legacy-peer-deps
|
||||
|
||||
COPY resources/ resources/
|
||||
COPY public/ public/
|
||||
RUN npm run production
|
||||
|
||||
# ──────────────────────────────────────────
|
||||
# Stage 2: Build del binario Go
|
||||
# Stage 1: Build del binario Go
|
||||
# Los assets del frontend (public/) se compilan localmente
|
||||
# antes del push con: npm run production
|
||||
# ──────────────────────────────────────────
|
||||
FROM golang:1.22-alpine AS builder
|
||||
WORKDIR /app
|
||||
@@ -25,8 +13,6 @@ COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
# Copiar assets del frontend compilados
|
||||
COPY --from=frontend /app/public ./public
|
||||
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o apiv2 .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user