zdravko/build/Dockerfile

44 lines
965 B
Text
Raw Normal View History

2024-02-16 21:31:00 +00:00
# syntax=docker/dockerfile:1
2024-02-17 20:56:08 +00:00
ARG GO_VERSION=1.21
2024-02-16 21:31:00 +00:00
FROM golang:${GO_VERSION} as builder
# Set destination for COPY
WORKDIR /app
# Download Go modules
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . ./
# Build
2024-02-17 19:19:18 +00:00
RUN CGO_ENABLED=1 GOOS=linux go build -o /bin/zdravko cmd/zdravko/main.go
2024-02-16 21:31:00 +00:00
###
# Final production
2024-02-18 10:34:03 +00:00
FROM gcr.io/distroless/base-debian12:latest as production
2024-02-17 19:19:18 +00:00
COPY --from=builder /bin/zdravko /bin/zdravko
2024-02-16 21:31:00 +00:00
COPY LICENSE /LICENSE
COPY README.md /README.md
# Zdravko Server
ENV PORT=8080
EXPOSE 8080
# Temporal UI Server
EXPOSE 8223
# Temporal GRPC Server
EXPOSE 7233
# Volume to persist sqlite databases
# as well as the keyvalue database.
ENV SQLITE_DATABASE_PATH=/data/zdravko.db
ENV TEMPORAL_DATABASE_PATH=/data/temporal.db
ENV KEYVALUE_DATABASE_PATH=/data/keyvalue.db
2024-02-16 21:31:00 +00:00
VOLUME /data
ENV DATABASE_PATH=/data/zdravko.db
ENV TEMPORAL_DATABASE_PATH=/data/temporal.db
2024-02-17 20:31:09 +00:00
ENTRYPOINT ["/bin/zdravko"]
CMD ["--server", "--temporal", "--worker"]