chore: run version command on build

This commit is contained in:
kieran 2024-11-12 10:38:22 +00:00
parent 5dfba80357
commit 28e4dd5b58
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
ARG IMAGE=rust:bookworm
ARG FEATURES
FROM $IMAGE as build
FROM $IMAGE AS build
WORKDIR /app/src
COPY src src
COPY migrations migrations
@ -34,12 +34,12 @@ RUN git clone --single-branch --branch release/7.1 https://git.v0l.io/ffmpeg/FFm
make -j$(nproc) install
RUN cargo install --path . --root /app/build --features "${FEATURES}"
FROM node:bookworm as ui_builder
FROM node:bookworm AS ui_builder
WORKDIR /app/src
COPY ui_src .
RUN yarn && yarn build
FROM $IMAGE as runner
FROM $IMAGE AS runner
WORKDIR /app
RUN apt update && \
apt install -y libx264-164 libwebp7 libvpx7 && \
@ -47,4 +47,5 @@ RUN apt update && \
COPY --from=build /app/build .
COPY --from=ui_builder /app/src/dist ui
COPY --from=build /app/ffmpeg/lib/ /lib
RUN ./bin/route96 --version
ENTRYPOINT ["./bin/route96"]

View File

@ -31,6 +31,8 @@ struct Args {
async fn main() -> Result<(), Error> {
pretty_env_logger::init();
let _args: Args = Args::parse();
let builder = Config::builder()
.add_source(config::File::with_name("config.toml"))
.add_source(config::Environment::with_prefix("APP"))
@ -40,8 +42,6 @@ async fn main() -> Result<(), Error> {
let db = Database::new(&settings.database).await?;
let _args: Args = Args::parse();
info!("Running DB migration");
db.migrate().await?;