Skip to content

Commit 6f95b06

Browse files
committed
Configure Docker image that runs tests
1 parent 13d6537 commit 6f95b06

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This is a test runner that allows you to avoid wasting time setting up the host machine
2+
FROM rust:1.78.0 as builder
3+
ENV CARGO_TERM_COLOR always
4+
RUN apt-get update && apt-get install -y libpq-dev
5+
6+
WORKDIR /usr/src/docker-test-runner
7+
# create empty project for caching dependencies
8+
RUN USER=root cargo init
9+
COPY Cargo.lock satellites-service/Cargo.toml ./
10+
# cache dependencies
11+
RUN cargo install --path . --locked
12+
13+
COPY satellites-service/ ./
14+
RUN touch src/main.rs
15+
RUN cargo install --path . --locked
16+
17+
FROM debian:bookworm-slim
18+
RUN apt-get update && apt-get install -y libpq-dev curl
19+
COPY --from=builder /usr/local/cargo/bin/satellites-service /bin/
20+
CMD ["satellites-service"]

0 commit comments

Comments
 (0)