Initial docker file and stuff
This commit is contained in:
12
service/Dockerfile
Normal file
12
service/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM rust:1.72.1-bookworm
|
||||
|
||||
WORKDIR /service
|
||||
USER root
|
||||
|
||||
COPY migrations ./migrations
|
||||
COPY src ./src
|
||||
COPY airport-codes.json Cargo.toml diesel.toml ./
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
CMD ["./target/release/weather-service"]
|
||||
@@ -45,7 +45,8 @@ async fn main() -> std::io::Result<()> {
|
||||
Some(listener) => server.listen(listener)?,
|
||||
None => {
|
||||
let host = std::env::var("SERVICE_HOST").expect("Please set host in .env");
|
||||
let port = std::env::var("SERVICE_PORT").expect("Please set port in .env");
|
||||
// let port = std::env::var("SERVICE_PORT").expect("Please set port in .env");
|
||||
let port = 5000;
|
||||
debug!("Binding server to {}:{}", host, port);
|
||||
server.bind(format!("{}:{}", host, port))?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user