New: Add goose to run migrations as an init container
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m56s
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m56s
This commit is contained in:
@@ -15,12 +15,18 @@ COPY . .
|
|||||||
# Build the application
|
# Build the application
|
||||||
RUN go build -o shortener
|
RUN go build -o shortener
|
||||||
|
|
||||||
|
# Install goose migration tool
|
||||||
|
RUN GOBIN=/app go install github.com/pressly/goose/v3/cmd/goose@latest
|
||||||
|
|
||||||
FROM golang:1.26-bookworm AS runner
|
FROM golang:1.26-bookworm AS runner
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
COPY --from=base /app/shortener /app/shortener
|
COPY --from=base /app/shortener /app/shortener
|
||||||
|
COPY --from=base /app/goose /app/goose
|
||||||
|
COPY --from=base /app/sql/schema /app/sql/schema
|
||||||
|
|
||||||
# Document the port that may need to be published
|
# Document the port that may need to be published
|
||||||
EXPOSE 8000
|
EXPOSE 8080
|
||||||
|
|
||||||
# Start the application
|
# Start the application
|
||||||
CMD ["/app/shortener"]
|
CMD ["/app/shortener"]
|
||||||
|
|||||||
Reference in New Issue
Block a user