-
Notifications
You must be signed in to change notification settings - Fork 18
chore: dockerfile.example #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c7a2e10
1fdd90e
6e89730
f737d2d
0546e9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,46 @@ | ||||||||
# ⚠️ IMPORTANT: This Dockerfile is for REFERENCE ONLY and is NOT production-ready. | ||||||||
# | ||||||||
# We do NOT recommend using this Dockerfile in production. Instead, use the official | ||||||||
# hookdeck/outpost image from Docker Hub: | ||||||||
# docker pull hookdeck/outpost:latest | ||||||||
# | ||||||||
# The official image is optimized, regularly updated, and fully supported. | ||||||||
# | ||||||||
# This example is provided for educational purposes and as a starting point for | ||||||||
# custom builds. If you need help with custom deployments, please create a | ||||||||
# discussion at: https://github.com/hookdeck/outpost/discussions | ||||||||
|
||||||||
# Stage 0 | ||||||||
# Build the binaries | ||||||||
FROM golang:1.23-alpine | ||||||||
WORKDIR /app | ||||||||
COPY go.mod go.sum ./ | ||||||||
RUN go mod download | ||||||||
COPY . . | ||||||||
|
||||||||
# Build all binaries | ||||||||
RUN go build -o ./bin/outpost ./cmd/outpost/main.go && \ | ||||||||
go build -o ./bin/outpost-server ./cmd/outpost-server/main.go && \ | ||||||||
go build -o ./bin/outpost-migrate-redis ./cmd/outpost-migrate-redis/main.go | ||||||||
|
||||||||
# Stage 1 | ||||||||
# Get busybox shell for entrypoint script | ||||||||
FROM busybox:1.36-musl AS busybox | ||||||||
|
||||||||
# Stage 2 | ||||||||
# Copy binaries to a new image | ||||||||
FROM gcr.io/distroless/base-debian12:nonroot | ||||||||
|
||||||||
# Copy statically linked shell from busybox for entrypoint script | ||||||||
COPY --from=busybox /bin/sh /bin/sh | ||||||||
|
||||||||
# Copy all binaries | ||||||||
COPY --from=0 /app/bin/outpost /usr/local/bin/outpost | ||||||||
COPY --from=0 /app/bin/outpost-server /usr/local/bin/outpost-server | ||||||||
COPY --from=0 /app/bin/outpost-migrate-redis /usr/local/bin/outpost-migrate-redis | ||||||||
|
||||||||
# Copy entrypoint script | ||||||||
COPY --from=0 /app/build/entrypoint.sh /usr/local/bin/entrypoint.sh | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The entrypoint script is copied but there's no verification that it exists or is executable. Consider adding a RUN command to make it executable:
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't think this is necessary because we're already executing |
||||||||
|
||||||||
# Default entrypoint runs migrations and starts server | ||||||||
ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"] |
Uh oh!
There was an error while loading. Please reload this page.