Skip to content

Commit f328f2b

Browse files
authored
Fix Docker compose healthcheck (UnownHash#44)
* Update Dockerfile * Maybe not curl... But wget :D
1 parent 410e2e8 commit f328f2b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
FROM busybox:uclibc AS busybox
2+
13
# Build image
24
FROM golang:1.22-alpine as build
35

@@ -13,6 +15,7 @@ RUN mkdir /empty-dir
1315

1416
# Now copy it into our base image.
1517
FROM gcr.io/distroless/static-debian11 as runner
18+
COPY --from=busybox /bin/wget /usr/bin/wget
1619
COPY --from=build /empty-dir /fletchling/logs
1720
COPY --from=build /go/src/app/db_store/sql /fletchling/db_store/sql
1821
COPY --from=build /go/bin/fletchling /go/bin/fletchling-osm-importer /go/bin/sleep /fletchling/

docker-compose.yml.example

+6-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ services:
1111
- /etc/localtime:/etc/localtime:ro
1212
ports:
1313
- "9042:9042"
14-
# fix after putting curl or wget into image.
15-
# healthcheck:
16-
# test: curl --fail http://localhost:9042/status || exit 1
17-
# interval: 60s
18-
# timeout: 30s
19-
# retries: 3
20-
# start_period: 30s
14+
healthcheck:
15+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9042/status"]
16+
interval: 60s
17+
timeout: 30s
18+
retries: 3
19+
start_period: 30s
2120

2221
# a container that starts and sleeps. this can be used
2322
# to exec into for the importer. See the 'docker-osm-importer.sh'

0 commit comments

Comments
 (0)