Skip to content

Commit

Permalink
feat: add debug image
Browse files Browse the repository at this point in the history
  • Loading branch information
x1unix committed Jul 1, 2023
1 parent 13243c3 commit 9d9b389
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions debug.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM golang:1.19-alpine as builder
ARG APP_VERSION='1.0.0'

COPY . /opt/stargazers-bot
WORKDIR /opt/stargazers-bot

RUN apk add --no-cache \
tzdata \
ca-certificates \
curl \
openssl \
bash \
alpine-sdk \
delve

RUN go build \
-o stargazers-server \
-gcflags="all=-N -l" \
-ldflags="-X 'github.com/x1unix/tg-stargazers-bot/internal/app.Version=$APP_VERSION-debug'" \
./cmd/stargazers-server

ENV PATH "$PATH:/opt/stargazers-bot"
ENV APP_ENV dev
ENV HTTP_LISTEN ':8080'
ENV HTTP_STATIC_DIR '/opt/stargazers-bot/public'

HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost:8080/ || exit 1

EXPOSE 8080
EXPOSE 2345

ENTRYPOINT dlv \
--listen=:2345 \
--headless=true \
--api-version=2 \
--accept-multiclient \
exec ./stargazers-server

0 comments on commit 9d9b389

Please sign in to comment.