coda/Dockerfile
Rodrigo Verdiani e1a262fec0 feat: scaffold Coda transcoder with docs, dev tooling and web base
Add the initial foundation for Coda, a Go/Docker service that converts
FLAC albums to MP3 320 kbps CBR, triggered by Lidarr webhooks or manually
from the web UI.

- docs: requirements and architecture (SQLite persistence, media volume,
  work window, manual FLAC search, env + web config)
- config: .env loader with env precedence
- web: embed/dev asset split, chi server, index template (DaisyUI + htmx)
- build: Makefile (setup/css/run/build/test/lint), Dockerfile (Tailwind
  standalone CLI + DaisyUI, no Node), .env.example, ignore rules
- docs: AGENTS.md and README for the project
2026-07-06 20:06:25 -03:00

30 lines
1.2 KiB
Docker

# Stage 1: generate CSS + fetch static assets (Tailwind + DaisyUI + htmx, no Node)
FROM alpine:3.20 AS assets
RUN apk add --no-cache curl
WORKDIR /src
ARG TAILWIND_VERSION=v4.1.14
ARG HTMX_VERSION=2.0.4
COPY web/ web/
RUN mkdir -p tools web/static \
&& curl -sLo tools/tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/download/${TAILWIND_VERSION}/tailwindcss-linux-x64-musl \
&& chmod +x tools/tailwindcss \
&& curl -sLo tools/daisyui.mjs https://github.com/saadeghi/daisyui/releases/latest/download/daisyui.mjs \
&& curl -sLo web/static/htmx.min.js https://unpkg.com/htmx.org@${HTMX_VERSION}/dist/htmx.min.js \
&& ./tools/tailwindcss -i web/styles/input.css -o web/static/app.css --minify
# Stage 2: build the Go binary (embeds web/static + templates)
FROM golang:1.25-alpine AS builder
WORKDIR /src
COPY . .
COPY --from=assets /src/web/static/app.css web/static/app.css
COPY --from=assets /src/web/static/htmx.min.js web/static/htmx.min.js
RUN go build -o /server ./cmd/server
# Stage 3: runtime
FROM alpine:3.20
RUN apk add --no-cache ffmpeg
COPY --from=builder /server /server
VOLUME ["/music", "/data"]
EXPOSE 8080
ENTRYPOINT ["/server"]