-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init cmmand #1447
Init cmmand #1447
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,4 @@ | ||
# Builder stage | ||
FROM rust:slim-buster AS builder | ||
|
||
WORKDIR /prod | ||
# Copy manifests and the graphql file | ||
COPY Cargo.lock Cargo.toml examples/jsonplaceholder.graphql docker.sh ./ | ||
|
||
ADD https://github.com/sclevine/yj/releases/download/v5.1.0/yj-linux-amd64 /usr/local/bin/yj | ||
ADD https://github.com/mikefarah/yq/releases/download/v4.40.5/yq_linux_amd64 /usr/local/bin/yq | ||
RUN chmod +x /usr/local/bin/yj /usr/local/bin/yq | ||
RUN chmod +x docker.sh && ./docker.sh | ||
|
||
# This is the trick to speed up the building process. | ||
RUN mkdir .cargo \ | ||
&& cargo vendor > .cargo/config | ||
|
||
# Install required system dependencies and cleanup in the same layer | ||
RUN apt-get update && apt-get install -y pkg-config libssl-dev python g++ git make libglib2.0-dev && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the rest of the source code | ||
COPY . . | ||
|
||
RUN chmod +x docker.sh && ./docker.sh | ||
|
||
# Compile the project | ||
RUN RUST_BACKTRACE=1 cargo build --release | ||
|
||
# Runner stage | ||
FROM fedora:41 AS runner | ||
|
||
# Copy necessary files from the builder stage | ||
COPY --from=builder /prod/target/release/tailcall /bin | ||
COPY --from=builder /prod/jsonplaceholder.graphql /jsonplaceholder.graphql | ||
|
||
ENV TAILCALL_LOG_LEVEL=error | ||
CMD ["/bin/tailcall", "start", "jsonplaceholder.graphql"] | ||
FROM ubuntu:latest | ||
RUN apt-get update && apt-get install -y curl | ||
RUN curl -sSL https://raw.githubusercontent.com/tailcallhq/tailcall/master/install.sh | bash -s -- v0.55.0 | ||
ENV PATH="${PATH}:~/.tailcall/bin" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Executing a script directly from a URL with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to
ubuntu:latest
as the base image might introduce unpredictability over time aslatest
will always point to the newest version. Consider using a more specific version tag (e.g.,ubuntu:20.04
) to ensure reproducibility and stability of your Docker builds.