-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: installing libpostal in docker images
- Loading branch information
Showing
5 changed files
with
30 additions
and
16 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
libpostal/ |
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,18 +1,20 @@ | ||
FROM golang:alpine as backend | ||
FROM golang:1.23-bookworm as backend | ||
ARG VERSION | ||
WORKDIR /src | ||
COPY . /src | ||
RUN go mod download | ||
RUN CGO_ENABLED=0 go build -ldflags "-X github.com/moov-io/watchman.Version=${VERSION}" -o ./bin/server /src/cmd/server | ||
RUN apt-get update && apt-get install -y curl autoconf automake libtool pkg-config | ||
RUN make install | ||
RUN go build -ldflags "-X github.com/moov-io/watchman.Version=${VERSION}" -o ./bin/server /src/cmd/server | ||
|
||
FROM node:21-alpine as frontend | ||
FROM node:22-bookworm as frontend | ||
ARG VERSION | ||
COPY webui/ /watchman/ | ||
WORKDIR /watchman/ | ||
RUN npm install --legacy-peer-deps | ||
RUN npm run build | ||
|
||
FROM alpine:latest | ||
FROM debian:bookworm | ||
LABEL maintainer="Moov <[email protected]>" | ||
COPY --from=backend /src/bin/server /bin/server | ||
COPY --from=frontend /watchman/build/ /watchman/ | ||
|
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,28 +1,38 @@ | ||
FROM quay.io/fedora/fedora:40-x86_64 as builder | ||
# Stage 1: Install dependencies with root privileges | ||
FROM registry.access.redhat.com/ubi9/go-toolset as builder-deps | ||
USER root | ||
RUN dnf install -y --allowerasing --setopt=tsflags=nodocs \ | ||
curl \ | ||
autoconf \ | ||
automake \ | ||
libtool \ | ||
pkgconfig \ | ||
&& dnf clean all | ||
|
||
# Stage 2: Build the application | ||
FROM registry.access.redhat.com/ubi9/go-toolset as builder | ||
ARG VERSION | ||
RUN yum install -y git golang make npm wget glibc | ||
WORKDIR /opt/app-root/src/ | ||
COPY --from=builder-deps /usr /usr | ||
COPY . . | ||
RUN go mod download | ||
RUN make install | ||
RUN VERSION=${VERSION} make build-server | ||
|
||
# Stage 3: Frontend build | ||
FROM node:21-bookworm as frontend | ||
COPY webui/ /watchman/ | ||
WORKDIR /watchman/ | ||
RUN npm install --legacy-peer-deps | ||
RUN npm run build | ||
|
||
FROM quay.io/fedora/fedora:40-x86_64 | ||
RUN yum install -y glibc | ||
|
||
# Stage 4: Final stage | ||
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5-1733767867 | ||
ARG VERSION=unknown | ||
LABEL maintainer="Moov <[email protected]>" | ||
LABEL name="watchman" | ||
LABEL version=$VERSION | ||
|
||
COPY --from=builder /opt/app-root/src/bin/server /bin/server | ||
|
||
COPY --from=frontend /watchman/build/ /watchman/ | ||
ENV WEB_ROOT=/watchman/ | ||
|
||
ENTRYPOINT ["/bin/server"] |
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