Skip to content

Commit f026337

Browse files
committed
fix website build issue
1 parent b149bde commit f026337

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

website/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
FROM golang:1.22.5-alpine AS builder
22
RUN adduser -D -g '' elf
3-
WORKDIR /opt/app/
3+
WORKDIR /opt/web/
44
COPY go.mod go.sum ./
55
RUN go mod download && go mod verify
66
COPY . .
7-
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o /go/bin/cinema-website ./cmd/app
7+
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o /go/bin/cinema-website ./cmd/web
88

99
# build smaller image
1010
FROM alpine:3.17.3
1111
LABEL language="golang"
1212
LABEL org.containers.image.source="https://github.com/mikebellcoder/microservices-docker-go-mongodb"
1313
COPY --from=builder /etc/passwd /etc/passwd
14+
WORKDIR /opt/web
1415
COPY --from=builder --chown=elf:1000 /go/bin/cinema-website /cinema-website
16+
COPY ./ui ui
1517
USER elf
1618
ENTRYPOINT [ "./cinema-website" ]

website/cmd/web/handlers_bookings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (app *application) bookingsView(w http.ResponseWriter, r *http.Request) {
128128
// get booking list from API
129129
var td bookingTemplateData
130130
app.infoLog.Println("Calling bookings API...")
131-
url := fmt.Sprintf("%s/%s", app.apis.bookings, &bookingID)
131+
url := fmt.Sprintf("%s/%s", app.apis.bookings, bookingID)
132132

133133
err := app.getAPIContent(url, &td.Booking)
134134
if err != nil {

0 commit comments

Comments
 (0)