zed/Dockerfile.migrator
Antonio Scandurra 2a763d0987 Upgrade sqlx-cli to v0.5.7 to fix compilation errors
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-09-07 18:51:10 +02:00

16 lines
496 B
Docker

# syntax = docker/dockerfile:1.2
FROM rust as builder
WORKDIR app
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=./target \
cargo install sqlx-cli --root=/app --target-dir=/app/target --version 0.5.7
FROM debian:buster-slim as runtime
RUN apt-get update; \
apt-get install -y --no-install-recommends libssl1.1
WORKDIR app
COPY --from=builder /app/bin/sqlx /app
COPY ./server/migrations /app/migrations
ENTRYPOINT ["/app/sqlx", "migrate", "run"]