Added build & run docker scripts

This commit is contained in:
2023-05-07 12:08:41 +02:00
parent 02c0673e64
commit ab14ca65c5
5 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
# App settings
Settings.toml

View File

@@ -0,0 +1,9 @@
FROM rust:1.61.0 as builder
# 2. Copy the files in your machine to the Docker image
COPY ./ ./
# Build your program for release
RUN cargo build --release
# Run the binary
CMD ["./target/release/test_weather_data"]

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
docker build . -t weather-microservice:latest

View File

@@ -14,3 +14,5 @@ influx_db_token="xxx"
latitude="xxx" latitude="xxx"
longitude="xxx" longitude="xxx"
``` ```
These settings can also be specified in the environment variables, when running in docker.

View File