38 lines
1.1 KiB
Docker
38 lines
1.1 KiB
Docker
![]() |
# Etapa de compilación
|
||
|
FROM golang:1.23.1-bookworm AS builder
|
||
|
|
||
|
ENV TZ=Europe/Madrid
|
||
|
|
||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||
|
ADD celsa2048.crt /usr/local/share/ca-certificates/celsa2048.crt
|
||
|
RUN chmod 644 /usr/local/share/ca-certificates/celsa2048.crt
|
||
|
RUN apt-get update \
|
||
|
&& apt-get install -y --no-install-recommends ca-certificates
|
||
|
|
||
|
RUN update-ca-certificates
|
||
|
WORKDIR /app
|
||
|
|
||
|
COPY . .
|
||
|
|
||
|
RUN go get -d -v ./...
|
||
|
|
||
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=mod -ldflags "-s -w" -o cml04-falcon-system main.go
|
||
|
|
||
|
# Etapa de producción
|
||
|
|
||
|
FROM debian:stable
|
||
|
ENV TZ=Europe/Madrid
|
||
|
|
||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||
|
ADD celsa2048.crt /usr/local/share/ca-certificates/celsa2048.crt
|
||
|
RUN chmod 644 /usr/local/share/ca-certificates/celsa2048.crt
|
||
|
RUN apt-get update \
|
||
|
&& apt-get install -y --no-install-recommends ca-certificates
|
||
|
ADD assets /root/assets
|
||
|
ADD templates /root/templates
|
||
|
RUN update-ca-certificates
|
||
|
WORKDIR /root/
|
||
|
|
||
|
COPY --from=builder /app/cml04-falcon-system .
|
||
|
|
||
|
CMD ["./cml04-falcon-ui"]
|