Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry committed Nov 4, 2023
1 parent fba48f1 commit dfe7ebc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM golang:1.21

WORKDIR /app
COPY . /app/
RUN go build -o main .
EXPOSE 3000
ENTRYPOINT ["./main"]
4 changes: 2 additions & 2 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func generatePdf(dog Dog) error {
return err
}

page := wkhtmltopdf.NewPage("http://localhost:3000/invoice/" + strconv.Itoa(dog.ID))
page := wkhtmltopdf.NewPage(os.Getenv("BASE_URL") + "/invoice/" + strconv.Itoa(dog.ID))

pdfGenerator.AddPage(page)

Expand Down Expand Up @@ -81,7 +81,7 @@ func sendEmail(dog Dog) error {

m := gomail.NewMessage()
m.SetHeader("From", fmt.Sprintf("Canine Club<%s>", os.Getenv("SMTP_USER")))
m.SetHeader("To", fmt.Sprintf("%s <%s>", dog.OwnerName, os.Getenv("SMTP_USER")))
m.SetHeader("To", fmt.Sprintf("%s <%s>", dog.OwnerName, dog.Email))
m.SetHeader("Subject", "Canine Club - Invoice for "+dog.Name)
m.SetBody(
"text/html",
Expand Down

0 comments on commit dfe7ebc

Please sign in to comment.