Some checks failed
Build and Deploy Container / build_and_deploy (push) Failing after 33s
35 lines
946 B
Docker
35 lines
946 B
Docker
# Stage 1: Builder
|
|
# We use a lightweight Wolfi image to gather the files.
|
|
# In a real build process, this might involve 'npm run build', but for static files,
|
|
# we just copy them. Using a stage here allows for future extensibility.
|
|
FROM cgr.dev/chainguard/wolfi-base AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy all files to the builder stage
|
|
COPY . .
|
|
|
|
# Stage 2: Final
|
|
# Use the official Wolfi base image and install Caddy manually
|
|
# since the pre-built Caddy image requires authentication or is restricted.
|
|
FROM cgr.dev/chainguard/wolfi-base:latest
|
|
|
|
# Install Caddy
|
|
RUN apk update && apk add caddy
|
|
|
|
# Copy the Caddyfile
|
|
COPY Caddyfile /etc/caddy/Caddyfile
|
|
|
|
# Copy the static site content from the builder stage
|
|
COPY --from=builder /app /usr/share/caddy
|
|
|
|
# Expose ports
|
|
# 80 for HTTP
|
|
# 443 for HTTPS (and HTTP/3 over UDP)
|
|
EXPOSE 80
|
|
EXPOSE 443
|
|
EXPOSE 443/udp
|
|
|
|
# Run Caddy
|
|
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
|