-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48c3300
commit 1fb372f
Showing
13 changed files
with
11 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,25 @@ | ||
FROM ubuntu:22.04 AS build | ||
# Build the application from source | ||
FROM golang:1.21 AS builder | ||
|
||
ARG GO_VERSION TARGETOS TARGETARCH | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ENV GO_VERSION=${GO_VERSION} | ||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common && \ | ||
add-apt-repository ppa:strukturag/libde265 && \ | ||
add-apt-repository ppa:strukturag/libheif && \ | ||
apt-get install -y --no-install-recommends cmake \ | ||
wget \ | ||
git \ | ||
gcc \ | ||
make \ | ||
pkg-config \ | ||
x265 \ | ||
libx265-dev \ | ||
libde265-dev \ | ||
libjpeg-dev \ | ||
libtool \ | ||
zlib1g-dev \ | ||
libaom-dev \ | ||
libheif1 \ | ||
libheif-dev && \ | ||
apt-get autoremove -y && \ | ||
apt-get purge -y --auto-remove && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget --no-check-certificate -P /tmp "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" && \ | ||
tar -C /usr/local -xzf "/tmp/go${GO_VERSION}.linux-amd64.tar.gz" && \ | ||
rm "/tmp/go${GO_VERSION}.linux-amd64.tar.gz" | ||
|
||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" | ||
|
||
WORKDIR /build | ||
WORKDIR /app | ||
|
||
COPY go.* ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags='-s -w' -trimpath -o /app/morphos . | ||
|
||
FROM ubuntu:22.04 | ||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o morphos . | ||
|
||
WORKDIR /app | ||
# Deploy the application binary into a lean image | ||
FROM debian:bookworm-slim AS release | ||
|
||
COPY --from=build /app/morphos . | ||
WORKDIR / | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common && \ | ||
add-apt-repository ppa:strukturag/libde265 && \ | ||
add-apt-repository ppa:strukturag/libheif && \ | ||
apt-get install -y --no-install-recommends cmake \ | ||
make \ | ||
pkg-config \ | ||
x265 \ | ||
libx265-dev \ | ||
libde265-dev \ | ||
libjpeg-dev \ | ||
libtool \ | ||
zlib1g-dev \ | ||
libaom-dev \ | ||
libheif1 \ | ||
libheif-dev && \ | ||
apt-get autoremove -y && \ | ||
apt-get purge -y --auto-remove && \ | ||
rm -rf /var/lib/apt/lists/* | ||
COPY --from=builder /app/morphos /bin/morphos | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/app/morphos"] | ||
ENTRYPOINT ["/bin/morphos"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters