Skip to content

Commit

Permalink
(feat) add docker implmentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tphoney committed Feb 20, 2024
1 parent 054e49a commit 67fb77e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 7 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM golang:latest as builder

# Set destination for COPY
WORKDIR /app

# Download Go modules
COPY go.mod go.sum ./
RUN go mod download

# Copy the source from the current directory
COPY *.go ./
COPY cinemaparadiso/*.go cinemaparadiso/
COPY cmd/*.go cmd/
COPY plex/*.go plex/
COPY types/*.go types/

# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o /plex-lookup

# Final stage
FROM scratch
COPY --from=builder /plex-lookup /plex-lookup
# Import the root certificate for HTTPS
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

CMD ["/plex-lookup"]
7 changes: 4 additions & 3 deletions cmd/cinemaparadiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package cmd
import (
"fmt"
"slices"
"tphoney/plex-lookup/cinemaparadiso"
"tphoney/plex-lookup/plex"
"tphoney/plex-lookup/types"

"github.com/tphoney/plex-lookup/cinemaparadiso"
"github.com/tphoney/plex-lookup/plex"
"github.com/tphoney/plex-lookup/types"

"github.com/spf13/cobra"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/plex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package cmd

import (
"fmt"
"tphoney/plex-lookup/plex"

"github.com/tphoney/plex-lookup/plex"

"github.com/spf13/cobra"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module tphoney/plex-lookup
module github.com/tphoney/plex-lookup

go 1.21.3

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"tphoney/plex-lookup/cmd"
"github.com/tphoney/plex-lookup/cmd"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion plex/plex.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"fmt"
"io"
"net/http"
types "tphoney/plex-lookup/types"

types "github.com/tphoney/plex-lookup/types"
)

type MediaContainer struct {
Expand Down

0 comments on commit 67fb77e

Please sign in to comment.