26 lines
1.0 KiB
Docker
26 lines
1.0 KiB
Docker
FROM golang:1.25-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./src/go.mod ./src/go.sum ./
|
|
RUN go mod tidy
|
|
|
|
COPY ./src .
|
|
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /gateway .
|
|
|
|
|
|
FROM alpine:latest AS certs
|
|
RUN apk --no-cache add ca-certificates
|
|
|
|
FROM scratch AS final
|
|
LABEL org.opencontainers.image.authors="remi.heredero@hevs.ch" \
|
|
org.opencontainers.image.title="PI-E2EEDA Gateway MQTT/Influx/REST" \
|
|
org.opencontainers.image.description="This container is an application for the E2EEDA PI. Use MQTT to communicate with devices, enabling real-time updates and control. Time-series data, such as device states, is stored in InfluxDB for analytics and monitoring. A REST API provides external access for managing devices and retrieving data." \
|
|
org.opencontainers.image.source="https://github.com/PI-E2EEDA/Plein-de-eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-project"
|
|
|
|
COPY --from=builder /gateway /gateway
|
|
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["/gateway"] |