fix: docker run references the correct database file

This commit is contained in:
Greg Heartsfield 2021-12-31 14:05:11 -06:00
parent 5a19a8876f
commit 415d32299b
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,6 @@ RUN cargo build --release
FROM debian:buster-slim FROM debian:buster-slim
ARG APP=/usr/src/app ARG APP=/usr/src/app
ARG APP_DATA=/usr/src/app/db ARG APP_DATA=/usr/src/app/db
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y ca-certificates tzdata sqlite3 \ && apt-get install -y ca-certificates tzdata sqlite3 \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -38,4 +37,6 @@ USER $APP_USER
WORKDIR ${APP} WORKDIR ${APP}
ENV RUST_LOG=info ENV RUST_LOG=info
CMD ["./nostr-rs-relay --db $APP_DATA"] ENV APP_DATA=${APP_DATA}
CMD ./nostr-rs-relay --db ${APP_DATA}

View File

@ -38,7 +38,6 @@ fn main() -> Result<(), Error> {
// get database directory from args // get database directory from args
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
let db_dir: Option<String> = db_from_args(args); let db_dir: Option<String> = db_from_args(args);
info!("Using database: {:?}", db_dir);
{ {
let mut settings = config::SETTINGS.write().unwrap(); let mut settings = config::SETTINGS.write().unwrap();
// replace default settings with those read from config.toml // replace default settings with those read from config.toml