-
Notifications
You must be signed in to change notification settings - Fork 1
/
dockerfile
38 lines (25 loc) · 895 Bytes
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM golang:1.20 AS build-stage
# Set destination for COPY
WORKDIR /
# Download Go modules
COPY go.mod go.sum ./
RUN go mod download
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY . ./
# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o /airplay-music-watcher
# Deploy the application binary into a lean image
FROM alpine/curl AS build-release-stage
WORKDIR /
COPY --from=build-stage /airplay-music-watcher /airplay-music-watcher
# Optional:
# To bind to a TCP port, runtime parameters must be supplied to the docker command.
# But we can document in the Dockerfile what ports
# the application is going to listen on by default.
# https://docs.docker.com/engine/reference/builder/#expose
EXPOSE 5353
# Run
USER root:root
VOLUME [ "/config" ]
ENTRYPOINT ["/airplay-music-watcher", "/config/config.json"]