Browse Source

dockerfile fixes

Aneurin Barker Snook 11 months ago
parent
commit
513bb19af9
1 changed files with 6 additions and 4 deletions
  1. 6 4
      Dockerfile

+ 6 - 4
Dockerfile

@@ -1,5 +1,5 @@
 # Build image
 # Build image
-FROM golang:1.21.3 AS build
+FROM golang:1.21 AS build
 
 
 WORKDIR /build
 WORKDIR /build
 
 
@@ -8,14 +8,16 @@ RUN mkdir -p /root/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts
 
 
 # Copy source
 # Copy source
 COPY go.mod go.sum main.go ./
 COPY go.mod go.sum main.go ./
+COPY internal ./internal
 
 
 # Install dependencies and build
 # Install dependencies and build
 RUN go install
 RUN go install
-RUN go build -o short-url-service
+RUN go build -o shorty
 
 
 # Distribution image
 # Distribution image
 FROM debian:12
 FROM debian:12
 
 
 # Copy binary and set as command
 # Copy binary and set as command
-COPY --from=build /build/short-url-service /usr/local/bin/short-url-service
-CMD ["short-url-service"]
+COPY --from=build /build/shorty /usr/local/bin/shorty
+ENTRYPOINT ["shorty"]
+CMD ["start"]