Skip to content

Commit c6fe84d

Browse files
committed
[package] use curl for healthcheck
1 parent c72bba5 commit c6fe84d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ docker-build:
4848
docker build -f build/package/Dockerfile -t $(image_name) --build-arg APP=$(project_name) .
4949

5050
docker:
51-
docker-compose -f deployments/docker-compose/docker-compose.yml up --build
51+
docker compose -f deployments/docker-compose/docker-compose.yml up --build
5252

5353
docker-dev:
54-
docker-compose -f deployments/docker-compose/docker-compose.dev.yml up --build
54+
docker compose -f deployments/docker-compose/docker-compose.dev.yml up --build
5555

5656
api-docs:
5757
swag fmt -g ./cmd/$(project_name)/main.go \
@@ -61,6 +61,6 @@ view-docs:
6161
php -S 127.0.0.1:8080 -t ./api
6262

6363
clean:
64-
docker-compose -f deployments/docker-compose/docker-compose.yml down --volumes
64+
docker compose -f deployments/docker-compose/docker-compose.yml down --volumes
6565

6666
.PHONY: init init-dev air db-upgrade db-upgrade-raw run test build install docker docker-dev api-docs view-docs clean

build/package/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ FROM alpine:3 AS prod
3333

3434
WORKDIR /app
3535

36-
RUN apk add --no-cache tzdata
36+
RUN apk add --no-cache tzdata \
37+
curl
3738

3839
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh
3940

@@ -43,6 +44,6 @@ COPY --from=build /go/src/app /app
4344
EXPOSE 3000
4445

4546
USER guest
46-
HEALTHCHECK --interval=10s --timeout=3s --retries=3 --start-period=5s CMD /app/app health || exit 1
47+
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 CMD curl -fs http://localhost:3000/health
4748

4849
ENTRYPOINT ["/docker-entrypoint.sh"]

0 commit comments

Comments
 (0)