feat: docker debug Dockerfile
This commit is contained in:
parent
5023d75fcd
commit
cda5d0cff2
52
Debug.Dockerfile
Normal file
52
Debug.Dockerfile
Normal file
@ -0,0 +1,52 @@
|
||||
FROM golang:alpine as builder
|
||||
|
||||
LABEL org.opencontainers.image.authors="psssix <psssix@gmail.com>"
|
||||
|
||||
# Build Delve
|
||||
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
||||
|
||||
# set build environmet variables needed for multistage building
|
||||
ENV CGO_ENABLED=0 \
|
||||
GOOS=linux
|
||||
|
||||
# source workdir
|
||||
WORKDIR /source
|
||||
|
||||
# Copy and download dependency using go mod
|
||||
# Vendoring
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy the code into the container
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN go build -gcflags="all=-N -l" -o /build/app .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
# Add entrypoint dependency
|
||||
#RUN apk add --no-cache bash mysql-client mariadb-connector-c
|
||||
|
||||
# Move to /backoffice_gateway directory as the place for resulting binary folder
|
||||
WORKDIR /
|
||||
|
||||
# Copy binary from build to main folder
|
||||
COPY --from=builder /go/bin/dlv .
|
||||
COPY --from=builder /build/app app
|
||||
|
||||
# Copy some application assets
|
||||
COPY --from=builder /source/deploy/docker/environment.sh ./docker/environment.sh
|
||||
COPY --from=builder /source/deploy/docker/logging.sh ./docker/logging.sh
|
||||
COPY --from=builder /source/entrypoint.sh .
|
||||
#COPY --from=builder /source/migrations ./migrations
|
||||
#COPY ./database/data.json /database/data.json
|
||||
|
||||
# Export necessary port
|
||||
EXPOSE 4040
|
||||
|
||||
# entry and start php-fpm server
|
||||
ENTRYPOINT ["bash", "/entrypoint.sh" ]
|
||||
|
||||
# Command to run when starting the container
|
||||
CMD ["/dlv", "--listen=:4040", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "/app"]
|
||||
@ -37,8 +37,8 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=builder /build/app app
|
||||
|
||||
# Copy some application assets
|
||||
#COPY --from=builder /source/docker/environment.sh ./docker/environment.sh
|
||||
#COPY --from=builder /source/docker/logging.sh ./docker/logging.sh
|
||||
#COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
||||
#COPY --from=builder /source/deploy/docker/logging.sh ./deploy/docker/logging.sh
|
||||
#COPY --from=builder /source/entrypoint.sh .
|
||||
#COPY --from=builder /source/migrations ./migrations
|
||||
#COPY ./database/data.json /database/data.json
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user