Files
aethera/Dockerfile
Evan Reichard 59de41f827
Some checks failed
continuous-integration/drone/push Build is failing
feat(build): embed static assets into Go binary
Embed frontend build output directly into Go binary using //go:embed.
This removes runtime dependency on ../frontend/public/ path and
simplifies Docker builds by serving assets from embedded filesystem.

- Add backend/web/embed.go with embed.FS directive
- Update server to serve from embedded static assets
- Update Makefile to copy frontend build to web/static/
- Update Dockerfile for simplified multi-stage build
- Update frontend package.json output paths
- Remove custom 'oc' command from flake.nix dev shell
2026-02-22 20:36:03 -05:00

31 lines
778 B
Docker

# Step 1: Build Frontend
FROM oven/bun:1 AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package.json frontend/bun.lock ./
RUN bun install --frozen-lockfile
COPY frontend/ ./
RUN bun run build
# Stage 2: Build Backend
FROM golang:1.25-alpine AS backend-builder
WORKDIR /app
RUN apk add --no-cache git
COPY backend/go.mod backend/go.sum ./
RUN go mod download
COPY backend/ ./
COPY --from=frontend-builder /app/frontend/public/ ./web/static/
RUN go build -ldflags="-w -s" -o aethera ./cmd
# Stage 3: Minimal Runtime
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=backend-builder /app/aethera .
RUN mkdir -p /app/data
EXPOSE 8080
ENV AETHERA_LISTEN=0.0.0.0
ENV AETHERA_PORT=8080
ENV AETHERA_DATA_DIR=/app/data
ENTRYPOINT ["./aethera"]