We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 963f9b9 commit a07d86aCopy full SHA for a07d86a
1 file changed
Dockerfile
@@ -1,15 +1,17 @@
1
-# ETAPA 1: Construcción (El taller)
+# ETAPA 1: Constructor (Builder)
2
FROM golang:1.24-alpine AS builder
3
WORKDIR /app
4
COPY . .
5
RUN go mod download
6
+# Compilamos el binario (go:embed incluirá api/static automáticamente)
7
RUN CGO_ENABLED=0 GOOS=linux go build -o main api/main.go
8
-# ETAPA 2: Ejecución (El cohete ligero)
9
-FROM scratch
+# ETAPA 2: Ejecución (Runtime)
10
+FROM alpine:latest
11
WORKDIR /root/
-# Solo copiamos el binario y los archivos visuales (Máxima seguridad y mínimo peso)
12
+
13
+# SOLO necesitamos el binario.
14
COPY --from=builder /app/main .
-COPY --from=builder /app/static ./static
15
16
EXPOSE 8080
17
CMD ["./main"]
0 commit comments