48d6d8c4d3
- Fix #11: Guard bcopy/bzero declarations with _VISUALCPP in commoninclude.h to avoid redefinition errors on macOS where <strings.h> provides them - Fix #12: Add --host flag to serve command, default 127.0.0.1 Docker now binds to 0.0.0.0 so Colima can reach the server from host - Also fix truncate() panic when n < 3
38 lines
952 B
Docker
38 lines
952 B
Docker
# Stage 1: Build akaiutil from source
|
|
FROM debian:11 AS akaiutil-builder
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY third_party/akaiutil/ /src/akaiutil/
|
|
WORKDIR /src/akaiutil
|
|
RUN make
|
|
|
|
# Stage 2: Build fetch (Go tool)
|
|
FROM golang:1.26-alpine AS fetch-builder
|
|
|
|
WORKDIR /src
|
|
COPY go.mod main.go serve.go /src/
|
|
COPY web/ /src/web/
|
|
RUN CGO_ENABLED=0 go build -o /fetch .
|
|
|
|
# Stage 3: Runtime image
|
|
FROM debian:11-slim
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
bash \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN mkdir -p /data/output/isos /data/output/wavs
|
|
|
|
COPY --from=akaiutil-builder /src/akaiutil/akaiutil /usr/local/bin/
|
|
COPY --from=fetch-builder /fetch /usr/local/bin/fetch
|
|
COPY scripts/extract_wavs.sh /usr/local/bin/
|
|
|
|
WORKDIR /data
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["fetch"]
|
|
CMD ["serve", "-p", "8080", "--host", "0.0.0.0"]
|