Introduces the Go photo-api service, nginx/systemd deploy wiring, and Next.js gallery/lightbox pages so event photos can be managed and browsed. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
955 B
Docker
26 lines
955 B
Docker
# Secondary deployment path (the primary is bare-metal systemd, see
|
|
# deploy/spanglish-photos.service). Built for the docker-compose "scale"
|
|
# setup or any container host.
|
|
#
|
|
# docker build -t spanglish-photo-api photo-api/
|
|
# docker run --env-file photo-api/.env -p 3020:3020 spanglish-photo-api
|
|
|
|
FROM golang:1.26 AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /photo-api ./cmd/photo-api
|
|
|
|
# debian-slim rather than distroless: HEIC conversion needs the libvips CLI.
|
|
FROM debian:bookworm-slim
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends libvips-tools ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY --from=build /photo-api /usr/local/bin/photo-api
|
|
RUN useradd -r -u 10001 photoapi && mkdir -p /data/photos && chown photoapi /data/photos
|
|
USER photoapi
|
|
ENV STORAGE_PATH=/data/photos
|
|
EXPOSE 3020
|
|
ENTRYPOINT ["/usr/local/bin/photo-api"]
|