Skip to content

Commit a07d86a

Browse files
fixed Dockerfile
1 parent 963f9b9 commit a07d86a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# ETAPA 1: Construcción (El taller)
1+
# ETAPA 1: Constructor (Builder)
22
FROM golang:1.24-alpine AS builder
33
WORKDIR /app
44
COPY . .
55
RUN go mod download
6+
# Compilamos el binario (go:embed incluirá api/static automáticamente)
67
RUN CGO_ENABLED=0 GOOS=linux go build -o main api/main.go
78

8-
# ETAPA 2: Ejecución (El cohete ligero)
9-
FROM scratch
9+
# ETAPA 2: Ejecución (Runtime)
10+
FROM alpine:latest
1011
WORKDIR /root/
11-
# Solo copiamos el binario y los archivos visuales (Máxima seguridad y mínimo peso)
12+
13+
# SOLO necesitamos el binario.
1214
COPY --from=builder /app/main .
13-
COPY --from=builder /app/static ./static
15+
1416
EXPOSE 8080
1517
CMD ["./main"]

0 commit comments

Comments
 (0)