WillSquire / docker-diesel-cli

Minimalistic Diesel CLI container.
7 stars 0 forks source link
diesel diesel-rs docker dockerfile rust

Diesel CLI

Minimalistic Diesel CLI container.

Usage

Run Diesel CLI:

docker run willsquire/diesel-cli

Commands

A practical example with setup:

docker run --rm \
  -v "$(pwd)":/app \
  --network="project_name_default" \
  willsquire/diesel-cli \
  --database-url="mysql://username:password@db_service/db_name" \
  setup

Note:

-v is the Rust project containing the migrates and config for Diesel.

--database-url is the database Diesel will connect to.

--network is needed only if the database is running within an existing docker network, e.g. in docker-compose. Usually the network name is the current directory name appended with _default.

See Diesel's docs for a full command list

Builds

Use in builds:

FROM willsquire/diesel-cli as builder
COPY . .
RUN diesel setup