up
This commit is contained in:
+3
-17
@@ -1,19 +1,7 @@
|
|||||||
# ──────────────────────────────────────────
|
# ──────────────────────────────────────────
|
||||||
# Stage 1: Build del frontend (assets JS/CSS)
|
# Stage 1: Build del binario Go
|
||||||
# ──────────────────────────────────────────
|
# Los assets del frontend (public/) se compilan localmente
|
||||||
FROM node:18-alpine AS frontend
|
# antes del push con: npm run production
|
||||||
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
|
|
||||||
# ──────────────────────────────────────────
|
# ──────────────────────────────────────────
|
||||||
FROM golang:1.22-alpine AS builder
|
FROM golang:1.22-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -25,8 +13,6 @@ COPY go.mod go.sum ./
|
|||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
COPY . .
|
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 .
|
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o apiv2 .
|
||||||
|
|
||||||
|
|||||||
+1
-5
@@ -72,10 +72,6 @@
|
|||||||
"axios": "^1.7.7",
|
"axios": "^1.7.7",
|
||||||
"css-loader": "^5.2.7",
|
"css-loader": "^5.2.7",
|
||||||
"flag-icons": "^6.15.0",
|
"flag-icons": "^6.15.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21"
|
||||||
"webpack": "^5.95.0"
|
|
||||||
},
|
|
||||||
"overrides": {
|
|
||||||
"webpack-cli": "4.10.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user