-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from jsoika/features/docker_support
Added files for docker support
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"actions": [ | ||
{ | ||
"device_name": "Stereo", | ||
"action": "start_playing", | ||
"command": "say 'stereo starting'" | ||
}, | ||
{ | ||
"device_name": "Stereo", | ||
"action": "end_playing", | ||
"command": "say 'stereo stopping'" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3" | ||
services: | ||
airplay-music-watcher: | ||
container_name: airplay-music-watcher | ||
image: airplay-music-watcher:latest | ||
network_mode: host | ||
volumes: | ||
- ./config.json:/config/config.json | ||
restart: unless-stopped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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"] | ||
|
||
|
||
|