2023-12-12 06:36:00 +05:30
|
|
|
# syntax=docker/dockerfile:1
|
2018-02-16 02:31:46 +05:30
|
|
|
|
2023-12-12 06:36:00 +05:30
|
|
|
FROM golang:1.21-alpine AS builder
|
|
|
|
|
|
|
|
COPY . /build
|
|
|
|
WORKDIR /build
|
|
|
|
RUN go mod download
|
2018-02-16 02:31:46 +05:30
|
|
|
|
2023-12-12 06:36:00 +05:30
|
|
|
RUN CGO_ENABLED=0 \
|
|
|
|
go build \
|
|
|
|
-trimpath \
|
|
|
|
-ldflags="-w -s" \
|
|
|
|
-o chrly \
|
|
|
|
main.go
|
2019-05-03 00:25:21 +05:30
|
|
|
|
2023-12-12 06:36:00 +05:30
|
|
|
FROM alpine:3.19
|
|
|
|
|
|
|
|
EXPOSE 80
|
2018-02-16 02:31:46 +05:30
|
|
|
ENV STORAGE_REDIS_HOST=redis
|
|
|
|
ENV STORAGE_FILESYSTEM_HOST=/data
|
|
|
|
|
2023-12-12 06:36:00 +05:30
|
|
|
COPY docker-entrypoint.sh /
|
|
|
|
COPY --from=builder /build/chrly /usr/local/bin/chrly
|
2018-02-16 02:31:46 +05:30
|
|
|
|
2023-12-12 06:36:00 +05:30
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
2018-02-16 02:31:46 +05:30
|
|
|
CMD ["serve"]
|