# Build stage to compile the Go server and the WebAssembly solver # Build from the repo root: cloudron build FROM golang:1.25 AS build WORKDIR /app COPY go.mod go.sum ./ RUN go mod download && apt-get clean && apt-get autoremove -y COPY . . # Build the WebAssembly solver RUN GOOS=js GOARCH=wasm go build -o web/static/solver.wasm ./cmd/wasm-solver && apt-get clean && apt-get autoremove -y # Build the server binary with the cloudron build tag (no built-in TLS, because the reverse proxy handles it) RUN CGO_ENABLED=1 go build -tags cloudron -o /build/hecapte ./cmd/server && apt-get clean && apt-get autoremove -y # Runtime stage FROM cloudron/base:5.0.0 RUN mkdir -p /app/code && apt-get clean && apt-get autoremove -y WORKDIR /app/code COPY --from=build /build/hecapte ./hecapte COPY --from=build /app/web ./web COPY --from=build /app/LICENSE.md /app/icon.png /app/code/ COPY --from=build /app/README.md ./README.md COPY start.sh /app/code/start.sh COPY CloudronManifest.json /app/code/CloudronManifest.json RUN chmod +x /app/code/start.sh && apt-get clean && apt-get autoremove -y CMD ["/app/code/start.sh"]