forked from lavina/lavina
add dockerfile
This commit is contained in:
parent
c662b64f11
commit
3de7a131f0
|
@ -0,0 +1,6 @@
|
|||
*
|
||||
!/src/
|
||||
!/migrations/
|
||||
!Cargo.lock
|
||||
!Cargo.toml
|
||||
!rust-toolchain
|
|
@ -1,2 +1,3 @@
|
|||
/target
|
||||
/db.sqlite
|
||||
.idea/
|
||||
|
|
|
@ -750,7 +750,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "lavina"
|
||||
version = "0.1.0"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"assert_matches",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "lavina"
|
||||
version = "0.1.0"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
FROM rust:1.72.0-alpine3.18@sha256:2f5592c561cef195c9fa4462633a674458dc375fc0ba4b80e7efe4c3c8e68403 as bld
|
||||
|
||||
RUN apk add --no-cache musl-dev
|
||||
COPY . .
|
||||
RUN cargo build --release
|
||||
|
||||
FROM alpine:3.18@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a
|
||||
|
||||
COPY --from=bld target/release/lavina /usr/bin/lavina
|
||||
VOLUME ["/etc/lavina/", "/var/lib/lavina/"]
|
||||
ENTRYPOINT ["lavina"]
|
|
@ -32,7 +32,10 @@ struct ServerConfig {
|
|||
}
|
||||
|
||||
fn load_config() -> Result<ServerConfig> {
|
||||
let raw_config = Figment::new().merge(Toml::file("config.toml"));
|
||||
// TODO get config path as a cmd line arg
|
||||
let raw_config = Figment::new()
|
||||
.merge(Toml::file("config.toml"))
|
||||
.merge(Toml::file("/etc/lavina/config.toml"));
|
||||
let config: ServerConfig = raw_config.extract()?;
|
||||
Ok(config)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue