From ea19ae27f8542573a043ff54278c59b5af0e3f58 Mon Sep 17 00:00:00 2001 From: Guntis Smaukstelis Date: Sat, 13 May 2023 21:09:49 +0300 Subject: [PATCH] Fly.io with one instance and one volume with auto_stop false --- .dockerignore | 1 - Dockerfile | 3 ++- fly.toml | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 3f05981..1058f53 100644 --- a/.dockerignore +++ b/.dockerignore @@ -24,7 +24,6 @@ **/*.log **/logs **/.DS_Store -**/data/* !**/project/assembly.sbt # flyctl launch added from .idea/.gitignore diff --git a/Dockerfile b/Dockerfile index 5f95541..8d39ab4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ FROM amazoncorretto:17-alpine -COPY ./data /data COPY ./web /web COPY ./target/scala-2.13/WeatherTool-assembly-0.1.1-SNAPSHOT.jar /app.jar +VOLUME /data + CMD ["java", "-jar", "/app.jar"] \ No newline at end of file diff --git a/fly.toml b/fly.toml index 173f633..eb80183 100644 --- a/fly.toml +++ b/fly.toml @@ -9,5 +9,13 @@ primary_region = "waw" [http_service] internal_port = 8080 force_https = true - auto_stop_machines = true + auto_stop_machines = false auto_start_machines = true + +[[mounts]] + source = "data_volume" + destination = "/data" + +[scale] + count = 1 + idle_timeout = 0 \ No newline at end of file