@@ -9,15 +9,8 @@ WORKDIR /go/src/github.com/diggerhq/digger/taco
99COPY cmd/statesman/ ./cmd/statesman/
1010COPY internal/ ./internal/
1111COPY pkg/sdk/ ./pkg/sdk/
12- COPY Makefile ./Makefile
1312
14- # Download Atlas amd64 binary for embedding into statesman binary
15- RUN apt-get update && apt-get install -y curl make && \
16- make atlas-download-binary && \
17- apt-get clean && \
18- rm -rf /var/lib/apt/lists/*
19-
20- # Download dependencies and build (Atlas binary will be embedded via go:embed)
13+ # Download dependencies and build
2114# Note: CGO is required for SQLite support
2215RUN cd cmd/statesman && \
2316 go mod tidy && \
@@ -26,47 +19,49 @@ RUN cd cmd/statesman && \
2619 -a \
2720 -o statesman .
2821
29- # Install Atlas CLI for migrations (fallback for dev/debugging)
30- RUN go install ariga.io/atlas/cmd/atlas@latest
31-
3222# Multi-stage build - use a minimal image for runtime
3323FROM ubuntu:24.04 AS runner
3424ARG COMMIT_SHA
3525WORKDIR /app
3626
37- # Install ca-certificates and curl for HTTPS requests
27+ # Install ca-certificates, curl for HTTPS requests
3828RUN apt-get update && \
3929 apt-get install -y ca-certificates curl && \
4030 apt-get clean && \
4131 rm -rf /var/lib/apt/lists/*
4232
4333RUN echo "commit sha: ${COMMIT_SHA}"
4434
45- # Install Atlas CLI for customer use
35+ # Install Atlas CLI for migrations
4636RUN curl -sSf https://atlasgo.sh | sh
4737
48- # Copy the binary from builder stage (contains embedded Atlas + migrations)
38+ # Copy the binary from builder stage
4939COPY --from=builder /go/src/github.com/diggerhq/digger/taco/cmd/statesman/statesman /app/statesman
5040
51- # Copy migration files for customer Atlas CLI usage
52- COPY --from=builder /go/src/github.com/diggerhq/digger/taco/internal/query/migration/atlas/migrations /app/migrations
41+ # Copy migration files
42+ COPY --from=builder /go/src/github.com/diggerhq/digger/taco/migrations /app/migrations
43+
44+ # Copy entrypoint script
45+ COPY --from=builder /go/src/github.com/diggerhq/digger/taco/scripts/entrypoint.sh /app/entrypoint.sh
5346
54- # Copy atlas.hcl for customer reference (optional)
47+ # Copy atlas.hcl for reference
5548COPY --from=builder /go/src/github.com/diggerhq/digger/taco/atlas.hcl /app/atlas.hcl
5649
57- # Make the binary executable
58- RUN chmod +x /app/statesman
50+ # Make scripts executable
51+ RUN chmod +x /app/statesman /app/entrypoint.sh
5952
6053# Expose the port that statesman runs on
6154EXPOSE 8080
6255
6356# Set environment variables with defaults
6457ENV OPENTACO_PORT=8080
6558ENV OPENTACO_STORAGE=memory
59+ ENV OPENTACO_BACKEND=sqlite
60+ ENV OPENTACO_SQLITE_PATH=/app/data/taco.db
6661
6762# Health check
6863HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
6964 CMD curl -f http://localhost:8080/healthz || exit 1
7065
71- # Run the statesman binary
72- ENTRYPOINT ["/app/statesman "]
66+ # Run via entrypoint script (applies migrations then starts statesman)
67+ ENTRYPOINT ["/bin/bash", "/ app/entrypoint.sh "]
0 commit comments