generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ftl-in-a-box Docker image (#1869)
- Loading branch information
1 parent
38de28c
commit 47d391b
Showing
2 changed files
with
78 additions
and
0 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
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,49 @@ | ||
FROM ubuntu:24.04 AS builder | ||
RUN apt-get update | ||
RUN apt-get install -y curl git zip | ||
|
||
# Seed some of the most common tools - this will be cached | ||
COPY ./bin /src/bin | ||
ENV PATH="/src/bin:$PATH" | ||
ENV HERMIT_STATE_DIR=/hermit | ||
RUN hermit uninstall jbr | ||
RUN hermit install openjre-18.0.2.1_1 | ||
# openjre and jbr conflict, but we want the JRE in the cache | ||
RUN hermit uninstall openjre | ||
RUN hermit install jbr | ||
RUN go version | ||
RUN mvn -f kotlin-runtime/ftl-runtime -B --version | ||
|
||
WORKDIR /src | ||
|
||
# Download Go dependencies separately so Docker will cache them | ||
COPY go.mod go.sum /src/ | ||
RUN go mod download -x | ||
|
||
COPY . /src/ | ||
|
||
# Build runner template | ||
RUN just build-kt-runtime | ||
|
||
# Build runner | ||
RUN just errtrace | ||
# Reset timestamps so that the build state is reset | ||
RUN git ls-files -z | xargs -0 touch -r go.mod | ||
RUN just build ftl | ||
|
||
# Finally create the runtime image. | ||
FROM ubuntu:24.04 | ||
|
||
WORKDIR /root/ | ||
|
||
ENV PATH="/root/jre/bin:$PATH" | ||
COPY --from=builder /hermit/pkg/openjre-18.0.2.1_1/ ./jre/ | ||
COPY --from=builder /src/build/template template | ||
COPY --from=builder /src/build/release/ftl-runner . | ||
COPY --from=builder /src/build/release/ftl . | ||
RUN mkdir deployments | ||
|
||
EXPOSE 8891 | ||
EXPOSE 8892 | ||
|
||
CMD ["/root/ftl", "dev"] |