2021-07-12 20:14:39 +00:00
|
|
|
# syntax = docker/dockerfile:1.2
|
|
|
|
|
2022-01-26 20:54:51 +00:00
|
|
|
FROM rust:1.58-bullseye as builder
|
2021-07-12 20:14:39 +00:00
|
|
|
WORKDIR app
|
|
|
|
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
|
|
|
--mount=type=cache,target=./target \
|
2021-09-07 16:51:10 +00:00
|
|
|
cargo install sqlx-cli --root=/app --target-dir=/app/target --version 0.5.7
|
2021-07-12 20:14:39 +00:00
|
|
|
|
2021-09-20 17:42:24 +00:00
|
|
|
FROM debian:bullseye-slim as runtime
|
2021-07-12 20:14:39 +00:00
|
|
|
RUN apt-get update; \
|
|
|
|
apt-get install -y --no-install-recommends libssl1.1
|
|
|
|
WORKDIR app
|
|
|
|
COPY --from=builder /app/bin/sqlx /app
|
2022-04-09 14:30:42 +00:00
|
|
|
COPY ./collab/migrations /app/migrations
|
2021-07-12 20:14:39 +00:00
|
|
|
ENTRYPOINT ["/app/sqlx", "migrate", "run"]
|