new docker-based build

This replaces the previous Dockerfile, which was a single stage for
building and deployment.

The new one is a multi-stage build. Its "dev" target has the full
development environment; its "deploy" target is more slim. It supports
cross-compiled builds via BuildKit, eg to prepare a build suitable for
a Raspberry Pi:

docker buildx build --load --platform=linux/arm64/v8 --tag=moonfire-nvr --progress=plain --target=deploy -f docker/Dockerfile .

Coming next: updating the installation docs.
This commit is contained in:
Scott Lamb
2021-01-15 09:54:10 -08:00
parent b2bf7bdfa4
commit 9349a2a164
8 changed files with 244 additions and 184 deletions

View File

@@ -28,11 +28,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
fn main() {
protobuf_codegen_pure::Codegen::new()
.out_dir(".")
fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(protobuf_codegen_pure::Codegen::new()
.out_dir(std::env::var("OUT_DIR")?)
.inputs(&["proto/schema.proto"])
.include("proto")
.run()
.expect("protoc");
.customize(protobuf_codegen_pure::Customize {
gen_mod_rs: Some(true),
..Default::default()
})
.run()?)
}

View File

@@ -37,9 +37,12 @@ mod compare;
pub mod db;
pub mod dir;
mod fs;
mod proto {
include!(concat!(env!("OUT_DIR"), "/mod.rs"));
}
mod raw;
pub mod recording;
mod schema;
use proto::schema;
pub mod signal;
pub mod upgrade;
pub mod writer;