-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: docker file and enahanced config structure
- Loading branch information
1 parent
088f894
commit aad46c1
Showing
4 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,15 @@ | ||
# Stage 1: Build the Go application | ||
FROM golang:1.23 AS go-builder | ||
|
||
# Set the working directory for Go | ||
WORKDIR /app | ||
|
||
# Install git to clone repositories | ||
RUN apt-get update && apt-get install -y git | ||
|
||
# Clone the Go repository (playground-mono) | ||
COPY . /app/playground-mono | ||
WORKDIR /app/playground-mono | ||
|
||
# Download Go module dependencies | ||
RUN go mod download | ||
COPY go.mod go.sum ./ | ||
RUN go mod download -x | ||
COPY . . | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o playground-mono . | ||
|
||
# Stage 2: Build the final container with the Go binary | ||
FROM alpine:latest | ||
RUN apk --no-cache add ca-certificates | ||
|
||
# Set the working directory for the final container | ||
WORKDIR /app | ||
|
||
# Copy Go binary from the Go builder stage | ||
COPY --from=go-builder /app/playground-mono/playground-mono /app/playground-mono | ||
|
||
COPY --from=go-builder /app/playground-mono . | ||
EXPOSE 8080 | ||
|
||
CMD sh -c "./playground-mono" | ||
CMD ["./playground-mono"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters