All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 5s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 8s
Build and upload Docker nightly image / build-and-push (push) Successful in 47s
- Switches the runtime base image from denoland/deno:alpine to alpine:latest for a more minimal and customizable environment. - Adds curl installation for optional health checks in containers.
37 lines
1.1 KiB
Docker
37 lines
1.1 KiB
Docker
# -------- Stage 1: Build the Deno application --------
|
|
FROM denoland/deno:latest AS builder
|
|
|
|
# Set the working directory inside the builder container
|
|
WORKDIR /app
|
|
|
|
# Copy the application source code and configuration files
|
|
COPY src/ ./src/
|
|
COPY deno.jsonc ./deno.jsonc
|
|
COPY import_map.json ./import_map.json
|
|
|
|
# Compile the application to a self-contained native binary
|
|
# Permissions and flags should be specified during compile time
|
|
RUN deno task compile
|
|
|
|
# -------- Stage 2: Minimal runtime environment --------
|
|
FROM alpine:latest
|
|
|
|
# Optional: Install curl for container-level health checks (not needed for production-only binaries)
|
|
RUN apk add --no-cache curl
|
|
|
|
# Copy only the compiled application binary from the builder stage
|
|
COPY --from=builder /app/app /app/app
|
|
|
|
# Set the working directory for the runtime container
|
|
WORKDIR /app
|
|
|
|
# Define expected environment variables (can be overridden at runtime)
|
|
ENV PROXY_HOST=0.0.0.0
|
|
ENV PROXY_PORT=8011
|
|
ENV LT_SERVER_HOST=localhost
|
|
ENV LT_SERVER_PORT=8010
|
|
ENV API_KEYS=demo-key
|
|
|
|
# Define the default command to run the application binary
|
|
CMD ["/app/app"]
|