Update Dockerfile to include embedded Caddy server
This commit is contained in:
parent
3339726a05
commit
2b2bac7f62
1 changed files with 9 additions and 3 deletions
12
Dockerfile
12
Dockerfile
|
@ -4,12 +4,18 @@ RUN mkdir /build
|
|||
ADD . /build/
|
||||
WORKDIR /build
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -buildvcs=false -installsuffix cgo -ldflags "-extldflags '-static'" -o main github.com/codemicro/palmatum/palmatum
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -a -buildvcs=false -installsuffix cgo -ldflags "-extldflags '-static'" -o main github.com/codemicro/palmatum/palmatum
|
||||
|
||||
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
|
||||
|
||||
RUN xcaddy build \
|
||||
--output caddy \
|
||||
--with github.com/codemicro/palmatum/caddyZipFs \
|
||||
--replace github.com/codemicro/palmatum=/build
|
||||
|
||||
FROM alpine
|
||||
COPY --from=builder /build/main /
|
||||
COPY --from=builder /build/caddy /
|
||||
WORKDIR /run
|
||||
|
||||
USER 997:997
|
||||
|
||||
CMD ["../main"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue