Skip to content

Commit 1890dd0

Browse files
committed
update bun
1 parent ead6f94 commit 1890dd0

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

bun.Dockerfile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ COPY package.json bun.lockb ./
1414
RUN bun install
1515

1616

17-
# Runtime dependencies are installed in a separate stage so that development
18-
# dependencies are not included in the final image. This reduces the size of the
19-
# final image.
20-
FROM base AS runtime-deps
21-
WORKDIR /app
22-
COPY package.json bun.lockb ./
23-
RUN bun install --production
24-
25-
2617
# This is the final stage of the build process. It copies the application code
2718
# and builds the application.
2819
FROM base AS builder
@@ -38,14 +29,15 @@ RUN bun build index.ts --outfile dist/index.js
3829
# the application code and the runtime dependencies from the previous stages.
3930
FROM oven/bun:${VERSION}-alpine AS runtime
4031
WORKDIR /app
32+
# Install ca-certificates to allow the application to make HTTPS requests
33+
RUN apk --update --no-cache add ca-certificates \
34+
&& update-ca-certificates 2>/dev/null || true
4135
# Install wget to allow health checks on the container. Then clean up the apt cache to reduce the image size.
4236
# e.g. `wget -nv -t1 --spider 'http://localhost:8080/health' || exit 1`
4337
RUN apk add --no-cache wget && rm -rf /var/cache/apk/*
4438
RUN addgroup --system nonroot && adduser --system --ingroup nonroot nonroot
4539
RUN chown -R nonroot:nonroot /app
4640

47-
# Copy the runtime dependencies from the runtime-deps stage
48-
COPY --chown=nonroot:nonroot --from=runtime-deps /app/node_modules ./node_modules
4941
# Copy the application from the build stage to the final stage.
5042
# You should change "dist" to the directory where your build output is located.
5143
COPY --chown=nonroot:nonroot --from=builder /app/dist ./dist

golang.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ RUN CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -t
4949
# reduce the size of the final image.
5050
FROM alpine:latest AS runtime
5151
WORKDIR /app
52+
# Install ca-certificates to allow the application to make HTTPS requests
53+
RUN apk --update --no-cache add ca-certificates \
54+
&& update-ca-certificates 2>/dev/null || true
5255
# Install wget to allow health checks on the container. Then clean up the apt cache to reduce the image size.
5356
# e.g. `wget -nv -t1 --spider 'http://localhost:8080/health' || exit 1`
5457
RUN apk add --no-cache wget && rm -rf /var/cache/apk/*

0 commit comments

Comments
 (0)