Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zalbiraw committed Sep 7, 2024
1 parent 350289c commit 0e574f3
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ COPY helpers/ helpers/
COPY services/ services/

# Build all the Go binaries
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-rest services/rest/rest/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-users services/rest/users/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-posts services/rest/posts/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-comments services/rest/comments/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-users services/graphql/users/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-posts services/graphql/posts/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-comments services/graphql/comments/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-notifications services/graphql/notifications/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-users services/graphql-subgraphs/users/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-posts services/graphql-subgraphs/posts/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-comments services/graphql-subgraphs/comments/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-notifications services/graphql-subgraphs/notifications/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-rest services/rest/rest/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-users services/rest/users/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-posts services/rest/posts/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/rest-comments services/rest/comments/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-users services/graphql/users/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-posts services/graphql/posts/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-comments services/graphql/comments/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-notifications services/graphql/notifications/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-users services/graphql-subgraphs/users/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-posts services/graphql-subgraphs/posts/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-comments services/graphql-subgraphs/comments/server.go
RUN CGO_ENABLED=0 GO111MODULE=on go build -o /go/bin/graphql-subgraphs-notifications services/graphql-subgraphs/notifications/server.go

# Stage 2: Create the final lightweight image
FROM alpine:latest

# Set the working directory
WORKDIR /root/
WORKDIR /go/src/github.com/zalbiraw/go-api-test-service

# Copy all the built binaries from the builder stage
COPY --from=builder /go/bin/* /usr/local/bin/
COPY --from=builder /go/src/github.com/zalbiraw/go-api-test-service/services /go/src/github.com/zalbiraw/go-api-test-service/services

0 comments on commit 0e574f3

Please sign in to comment.