diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-11-28 22:09:33 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-11-28 22:09:33 +0900 |
| commit | e8d43fd90725fbf715c7e1517aa7ce51c9465784 (patch) | |
| tree | 3904049ebabaa3c16aeab0cf75c20fbf13d9d679 | |
| parent | 7320d5326fca5faa76fc27500f918323ce2c32f5 (diff) | |
| download | feedaka-0.4.2.tar.gz feedaka-0.4.2.tar.zst feedaka-0.4.2.zip | |
feat(docker): Use distroless container as runtime containerv0.4.2
| -rw-r--r-- | Dockerfile | 11 | ||||
| -rw-r--r-- | compose.yaml | 2 |
2 files changed, 6 insertions, 7 deletions
@@ -10,12 +10,13 @@ COPY common/graphql/schema.graphql src/graphql/schema.graphql RUN npm run build ########################################## - -FROM golang:1.24-alpine AS backend-builder +FROM golang:1.24 AS backend-builder WORKDIR /app -RUN apk update && apk add --no-cache build-base sqlite +RUN apt-get update && \ + apt-get install -y libsqlite3-dev + COPY backend/go.mod backend/go.sum ./ RUN go mod download @@ -24,12 +25,10 @@ COPY --from=frontend-builder /app/dist/ ./public/ RUN CGO_ENABLED=1 GOOS=linux go build -o feedaka . ########################################## - -FROM alpine +FROM gcr.io/distroless/cc-debian12 WORKDIR /app COPY --from=backend-builder /app/feedaka /app -RUN mkdir -p /app/data EXPOSE 8080 CMD ["/app/feedaka"] diff --git a/compose.yaml b/compose.yaml index ba00ad9..3acb195 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,7 +3,7 @@ services: build: context: . volumes: - - ./data/feedaka.db:/app/data/feedaka.db + - ./data:/app/data ports: - '127.0.0.1:8002:8080' environment: |
