35 lines
631 B
Docker
35 lines
631 B
Docker
FROM golang:1.25.4-bookworm
|
|
|
|
# Install dependencies for telldus-core
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
cmake \
|
|
libftdi-dev \
|
|
libconfuse-dev \
|
|
wget \
|
|
unzip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY ./telldus-core /usr/src/telldus-core
|
|
WORKDIR /usr/src/telldus-core
|
|
RUN cmake . \
|
|
&& make \
|
|
&& make install \
|
|
&& ldconfig
|
|
|
|
# Set workdir for the project
|
|
WORKDIR /go/src/app
|
|
|
|
# Copy go mod and download dependencies
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN go build -o main .
|
|
|
|
# Run the application
|
|
CMD ["./main"]
|