Skip to content

Commit ae8e865

Browse files
Merge pull request #200 from DefangLabs/jordan/slim-healthchecks
Slim healthchecks
2 parents 5a10cea + 8764df9 commit ae8e865

File tree

39 files changed

+71
-26
lines changed

39 files changed

+71
-26
lines changed

samples/django-postgres/app/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Use an official Python runtime as a parent image
22
FROM python:3.11-slim
33

4+
RUN apt-get update && apt-get install -y curl
5+
46
# Set environment variables
57
ENV PYTHONDONTWRITEBYTECODE 1
68
ENV PYTHONUNBUFFERED 1
@@ -19,4 +21,4 @@ COPY . /code/
1921
RUN python manage.py collectstatic --noinput
2022

2123
# Start server
22-
CMD python manage.py migrate && python manage.py createsuperuser && gunicorn crm_platform.wsgi:application --bind 0.0.0.0:8000
24+
CMD python manage.py migrate && python manage.py createsuperuser && gunicorn crm_platform.wsgi:application --bind 0.0.0.0:8000

samples/django/app/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Use an official Python runtime as a parent image
22
FROM python:3.11-slim
33

4+
RUN apt-get update && apt-get install -y curl
5+
46
# Set environment variables
57
ENV PYTHONDONTWRITEBYTECODE 1
68
ENV PYTHONUNBUFFERED 1

samples/golang-http-form/app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM alpine:latest
20+
FROM golang:1.20-slim
2121

22-
RUN apk --no-cache add ca-certificates
22+
RUN apt update && apt install -y curl ca-certificates
2323

2424
WORKDIR /root/
2525

samples/golang-http-form/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ services:
1212
reservations:
1313
memory: 50M
1414
healthcheck:
15-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/"]
15+
test: ["CMD", "curl", "-f", "http://localhost:8080/"]

samples/golang-mongodb-atlas/app/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o taskmanager .
1818

1919
# Start a new stage from scratch
20-
FROM alpine:latest
20+
FROM golang:1.20-slim
21+
22+
RUN apt update && apt install -y curl ca-certificates
2123

2224
WORKDIR /root/
2325

@@ -30,4 +32,3 @@ EXPOSE 8080
3032

3133
# Command to run the executable
3234
CMD ["./taskmanager"]
33-

samples/golang-mongodb-atlas/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ services:
1414
# resources:
1515
# reservations:
1616
# memory: 256M
17+
healthcheck:
18+
test: ["CMD", "curl", "-f", "http://localhost:8080/"]

samples/golang-openai/app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM alpine:latest
20+
FROM golang:1.20-slim
2121

22-
RUN apk --no-cache add ca-certificates
22+
RUN apt update && apt install -y curl ca-certificates
2323

2424
WORKDIR /root/
2525

samples/golang-openai/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ services:
1414
reservations:
1515
memory: 50M
1616
healthcheck:
17-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/"]
17+
test: ["CMD", "curl", "-f", "http://localhost:8080/"]

samples/golang-rest-api/app/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ COPY . .
1717
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
1818

1919
# Start a new stage from scratch
20-
FROM alpine:latest
20+
FROM golang:1.20-slim
2121

22-
RUN apk --no-cache add ca-certificates
22+
RUN apt update && apt install -y curl ca-certificates
2323

2424
WORKDIR /root/
2525

samples/golang-rest-api/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ services:
1212
reservations:
1313
memory: 50M
1414
healthcheck:
15-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/"]
15+
test: ["CMD", "curl", "-f", "http://localhost:8080/"]

0 commit comments

Comments
 (0)