Skip to content

Commit d78fb77

Browse files
add back dockerfile
1 parent 8e3416e commit d78fb77

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/actions/docker-publish/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ inputs:
1515
docker_platforms:
1616
require: true
1717
docker_file:
18-
default: deployment/Dockerfile
18+
default: Dockerfile
1919
require: true
2020
docker_username:
2121
require: true

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Stage 1: Build
2+
FROM lukemathwalker/cargo-chef:latest-rust-1.79 as chef
3+
WORKDIR /build/
4+
# hadolint ignore=DL3008
5+
6+
FROM chef as planner
7+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
8+
COPY . .
9+
RUN cargo chef prepare --recipe-path recipe.json --bin fuel-block-committer
10+
11+
FROM chef as builder
12+
COPY --from=planner /build/recipe.json recipe.json
13+
# Build our project dependencies, not our application!
14+
RUN cargo chef cook --release --recipe-path recipe.json --bin fuel-block-committer
15+
# Up to this point, if our dependency tree stays the same,
16+
# all layers should be cached.
17+
COPY . .
18+
RUN cargo build --release --bin fuel-block-committer
19+
20+
# Stage 2: Run
21+
FROM ubuntu:22.04 as run
22+
23+
RUN apt-get update -y \
24+
&& apt-get install -y --no-install-recommends ca-certificates \
25+
# Clean up
26+
&& apt-get autoremove -y \
27+
&& apt-get clean -y \
28+
&& rm -rf /var/lib/apt/lists/*
29+
30+
WORKDIR /root/
31+
32+
COPY --from=builder /build/target/release/fuel-block-committer .
33+
COPY --from=builder /build/target/release/fuel-block-committer.d .
34+
35+
ENTRYPOINT ["./fuel-block-committer"]

0 commit comments

Comments
 (0)